[LLVMbugs] [Bug 7714] New: probable clang wrong code bug on x64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 25 23:38:56 PDT 2010


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

           Summary: probable clang wrong code bug on x64
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


Oddly, I think the -O0 output is wrong.

[regehr at bethe work011]$ clang -O0 small.c -o small
[regehr at bethe work011]$ ./small
0
[regehr at bethe work011]$ clang -O1 small.c -o small
[regehr at bethe work011]$ ./small
-1
[regehr at bethe work011]$ cat small.c
extern int printf (__const char *__restrict __format, ...);

struct S0 {
  short f0;
  unsigned f1;
  int f2;
};

int g_12[3] = {-10L, -10L, -10L};

void func_2(int p_3, struct S0 p_4)
{
  if (p_4.f0) g_12[2] = p_3;
}

int main(void)
{
  struct S0 g_57 = {1L,8L,-6L};
  func_2 (-1L, g_57);
  printf ("%d\n", g_12[2]);
  return 0;
}
[regehr at bethe work011]$ clang -v
clang version 2.8 (trunk 109392)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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