[LLVMbugs] [Bug 9483] New: [Win32][MCAsm][MCCOFF] local storage is unaware of required alignment

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 15 05:17:36 PDT 2011


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

           Summary: [Win32][MCAsm][MCCOFF] local storage is unaware of
                    required alignment
           Product: libraries
           Version: 2.9
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: geek4civic at gmail.com
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 9441


MCAsmStreamer::EmitLocalCommonSymbol() and
WinCOFFStreamer::EmitLocalCommonSymbol() lose alignment information.
It causes runtime error. eg. -globalopt introduces many opportunities to use
movdqa.

I confirmed with i686-mingw32.

; b.ll
@foo = internal global i8 0, align 1
@bar = internal global <4 x i32> zeroinitializer, align 16
@baz = internal global i8 0, align 256

@pfoo = global i8* @foo, align 4
@pbar = global <4 x i32>* @bar, align 4
@pbaz = global i8* @baz, align 4

# b.s
    .lcomm    _foo,1
    .lcomm    _bar,16
    .lcomm    _baz,1
    .data
    .globl    _pfoo
    .align    4
_pfoo:
    .long    _foo

    .globl    _pbar
    .align    4
_pbar:
    .long    _bar

    .globl    _pbaz
    .align    4
_pbaz:
    .long    _baz

$ as && ld && nm -n
00403000 B __bss_start__
00403000 b _foo
00403008 b _bar        ### miss
00403018 b _baz        ### miss
00403020 B __bss_end__

$ llc -filetype=obj && ld && nm -n
00403000 B __bss_end__
00403000 b _bar        ### casual?
00403010 b .bss$linkonce_baz
00403010 b _baz        ### miss
00403011 b .bss$linkonce_foo
00403011 b _foo
00405000 I ___crt_xc_end__

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