[LLVMbugs] [Bug 13952] New: [ppc64] Bitfield with default signedness not loaded

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 27 10:25:52 PDT 2012


             Bug #: 13952
           Summary: [ppc64] Bitfield with default signedness not loaded
           Product: libraries
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: wschmidt at linux.vnet.ibm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the 64-bit PowerPC SVR4 subtarget, one of the GCC ABI compatibility tests
generates bad code for a bitfield reference with unspecified signedness.  The
test applies -funsigned-bitfields to coerce this.  There are three one-bit
bitfields, one of which is signed, one unsigned, and one default.  The
explicitly signed and unsigned bitfields are loaded properly.  For the
default-signedness bitfield, the load of the bitfield is replaced by a
load-immediate of zero.  The code for the unsigned bitfield is:

        .loc    2 11 3
        ld 3, 128(31)
        lwz 4, 0(3)
        rlwinm 4, 4, 2, 31, 31
        cmplwi 0, 4, 0
        bne 0, .LBB0_4
        b .LBB0_3

whereas the code for the default bitfield is:

        li 3, 0
        .loc    2 13 3
        cmplwi 0, 3, 0
        bne 0, .LBB0_6
        b .LBB0_5

The test is in the GCC ABI compatibility test suite.  Compilation that produces
the above code gen is:

/home/wschmidt/llvm/install/llvm-base/bin/clang++ -w -ansi -pedantic-errors
-funsigned-bitfields -c -m64 -o cp_compat_y_alt.o

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