[LLVMbugs] [Bug 8252] New: Problems with ARM PIC codegen

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 28 15:32:55 PDT 2010


           Summary: Problems with ARM PIC codegen
           Product: tools
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: pdox at alum.mit.edu
                CC: llvmbugs at cs.uiuc.edu

I have traced the problem to inconsistency over whether the constants MO_LO16,
MO_HI16, MO_PLT represent flags (bits) or absolute states.

The constants as defined in ARMBaseInfo.h are:
MO_LO16 = 1
MO_HI16 = 2
MO_PLT = 3

However, in ARMAsmPrinter.cpp, the following code appears:

    if ((Modifier && strcmp(Modifier, "lo16") == 0) ||
        (TF & ARMII::MO_LO16))
      O << ":lower16:";
    else if ((Modifier && strcmp(Modifier, "hi16") == 0) ||
             (TF & ARMII::MO_HI16))
      O << ":upper16:";

Unfortunately, when TF == MO_PLT, this code will emit ":lower16:" when it
should not emit anything. (causing assembler errors)

In ARMMCInstLower.cpp, code like this appears:
  case ARMII::MO_LO16:
  case ARMII::MO_HI16:
  case ARMII::MO_PLT:

Suggesting these are mutually exclusive states and not flags.

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