[LLVMbugs] [Bug 6910] New: LLVM broken with -O3, or -O1 -ftree-vectorize

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 23 14:25:10 PDT 2010


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

           Summary: LLVM broken with -O3, or -O1 -ftree-vectorize
           Product: new-bugs
           Version: unspecified
          Platform: PC
               URL: https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1984
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


See
https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1984

CXXFLAGS="-march=pentium4 -O1 -ftree-vectorize -m32"
This causes LLVM to crash on startup.

You can easily reproduce this, by putting this code into PassManager.cpp:
int main()
{
    printf("%d\n",__alignof(FPPassManager));
    FPPassManager *P = new FPPassManager(1);
    FPPassManager *P2 = new FPPassManager(1);
    return 0;
}

alignof is 16, but new is only guaranteed to return 8-byte aligned data.

This is because LLVM uses attribute((aligned)) in SmallVector.

See these bugs on why this is neither a gcc bug, nor a glibc bug, ...
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795
http://sourceware.org/bugzilla/show_bug.cgi?id=206

The fix is to remove #ifdef __GNUC__ __attribute((aligned)) from SmallVector
and just rely on the unions for alignment (they create alignof 4, and not 16).

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