[LLVMbugs] [Bug 1374] NEW: [inlineasm] More problems with early clobbers

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Apr 30 20:42:56 PDT 2007


           Summary: [inlineasm] More problems with early clobbers
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: isanbard at gmail.com

This is the same type of problem we were seeing in PR1357:

This program:

void bork(void) {
  static const struct {
    unsigned long want_dh,want_dl, mh,ml, sh,sl;
  } data[] = {
    { 0,0,  1,2,  1,2 },
    { 0,0,  0,1,  0,1 }
  int i;
  unsigned long got_dh, got_dl;

  for (i = 0; i < (sizeof (data) / sizeof ((data)[0])); i++) {
    __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2"
             : "=r" (got_dh), "=&r" (got_dl)
             : "r" (data[i].mh), "r" (data[i].sh), "rI" (data[i].ml), "r" (data[i].sl));

    if (got_dh != data[i].want_dh || got_dl != data[i].want_dl) {
      abort ();

Gives this error:

check_data wrong at data[0]  mh=1
  want dh=0
  want dl=0
  got dh =4294967295
  got dl =0
Abort trap

Generates code like this:

        # InlineAsm Start
        subfc r2,r5,r4
        subfe r27,r3,r2
        # InlineAsm End
        stw r2, 60(r1)


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list