[LLVMbugs] [Bug 9539] New: Bad code generation with r128175

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 23 16:19:23 PDT 2011


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

           Summary: Bad code generation with r128175
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


Testcase:
#include <stdio.h>
typedef __int128_t x;
__attribute((noinline)) int a(x i, x j, int *p, int z) {
  int k = i>j;
  int l = (k?11:111)/z;
  asm volatile ("" :::"memory", "rcx", "rax", "rdx", "rbx", "rsi", "rdi",
"rbp", "r9", "r10", "r11", "r12", "r13", "r14", "r15");
  *p = l;
  if (k) return 201/z;
  return 0;
}
int main() {
  int x;
  printf("%d\n", a(1, 0, &x, 1));
}

The compiled program built with clang crashes on x86-64 Linux.  The issue is
that the code generated to spill EFLAGS corrupts values spilled into the red
zone.

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