[LLVMbugs] [Bug 14843] New: Dragonegg mishandles odd-sized struct argument (miscompiles with -O1)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 7 20:51:00 PST 2013


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

             Bug #: 14843
           Summary: Dragonegg mishandles odd-sized struct argument
                    (miscompiles with -O1)
           Product: dragonegg
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: New Bugs
        AssignedTo: baldrick at free.fr
        ReportedBy: geek4civic at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


// testcase.cpp

struct I24 {bool x; bool y; bool z;};
int foo(I24 a) { return a.z; }

Dragonegg emits like;

%struct.I24 = type { i8, i8, i8 }

define i32 @_Z3foo3I24(i32 %a.0)
  %a_addr = alloca %struct.I24, align 1
  %0 = bitcast %struct.I24* %a_addr to { i32 }*
  %1 = getelementptr inbounds { i32 }* %0, i32 0, i32 0
  store i32 %a.0, i32* %1, align 1

SROA invalidates such a overwidth store with -O1.

FYI, clang emits like;

define i32 @_Z3foo3I24(i24 %a.coerce)
  %1 = alloca i24
  store i24 %a.coerce, i24* %1

I am using gcc-4.7.0.

-- 
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