First Last Prev Next    No search results available
Details
: [cbackend] Logical constant expressions (and/or/xor) not ...
Bug#: 490
: libraries
: Backend: C
Status: VERIFIED
Resolution: FIXED
: All
: All
: 1.4
: P2
: normal
: 1.5

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Assigned To: Chris Lattner <clattner@apple.com>

Attachments
File to reproduce the error (on linux/i386). (1.26 KB, text/plain)
2004-12-28 12:06, Markus F.X.J. Oberhumer
Details
Reduced test case (2.96 KB, text/plain)
2004-12-28 13:48, John T. Criswell
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-12-28 12:04
The attached program generates an internal error.

CWriter Error: Unhandled constant expression:  int and (int 1, int select (bool
setlt (uint sub (uint cast (void ()* %test_2_end to uint), uint cast (uint
(uint)* %test_2_start to uint)), uint 32), int -1, int select (bool setlt (uint
sub (uint cast (void ()* %test_1_end to uint), uint cast (uint (uint)*
%test_1_start to uint)), uint 32), int -1, int 3)))

llvm 1.3 generates a similar but not identical error.
------- Comment #1 From Markus F.X.J. Oberhumer 2004-12-28 12:06:01 -------
Created an attachment (id=192) [details]
File to reproduce the error (on linux/i386).
------- Comment #2 From John T. Criswell 2004-12-28 13:48:39 -------
Created an attachment (id=195) [details]
Reduced test case

This is LLVM assembly code that I reduced from the previous test case. 
Assembling it and running llc should re-generate the error.

I believe an optimization pass in gccas or gccld is creating this code.  I got
this code by compiling the program and disassembling it with llvm-dis.	Using
llvm-gcc -S to generate assembly and using llvm-as to assemble it does not
produce the same bytecode file.
------- Comment #3 From Chris Lattner 2004-12-28 22:01:49 -------
Fixed.  Testcase here:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022732.html

Patch here:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041227/022733.html

Thanks for finding this, and major thanks to John for reducing the testcase.

-Chris
------- Comment #4 From Chris Lattner 2004-12-28 22:17:29 -------
I should note, however, that the code triggering the problem is NOT a portable
way to get the size of a function (there is none).  LLVM may choose to rearrange
functions as it wants, so you can't really count on layout like this.  In
practice it will probably work most of the time though.

-Chris

First Last Prev Next    No search results available