[LLVMbugs] [Bug 8268] New: constant folder misses negative GEP

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 30 22:54:22 PDT 2010


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: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list