http://llvm.org/bugs/show_bug.cgi?id=8268

           Summary: constant folder misses negative GEP
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=5546)
 --> (http://llvm.org/bugs/attachment.cgi?id=5546)
.ll of foo() after -O2

The C++ testcase on Linux is:

  #include <string>
  using namespace std;
  void foo() { string s; }

which optimizes down to nothing with gcc, but produces the attached .ll file in
clang++. The problem is this hideous constant expression:

i1 icmp eq ([0 x i32]* bitcast (i8* getelementptr (%"_Rep"* bitcast ([0 x i32]*
@foo to %"_Rep"*), i32 1, i32 0, i32 -12) to [0 x i32]*), [0 x i32]* @foo)

where %"_Rep" = type { [12 x i8] } . Target data is available, though offhand I
don't think it should be needed.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to