[LLVMbugs] [Bug 8677] New: likely integer wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 23 20:23:33 PST 2010


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

           Summary: likely integer wrong code bug
           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


The -O1 result is correct.

regehr at home:~/volatile/bugs/tmp342$ clang -O1 small.c -o small
regehr at home:~/volatile/bugs/tmp342$ ./small
1
regehr at home:~/volatile/bugs/tmp342$ clang -O2 small.c -o small
regehr at home:~/volatile/bugs/tmp342$ ./small
-1
regehr at home:~/volatile/bugs/tmp342$ cat small.c
int printf (const char *format, ...);

static int g_23 = 1;

static int func_16 (int p_19)
{
  g_23 = -1;
  return p_19;
}

int main (void) 
{
  int *l_172[1];
  int **l_176 = &l_172[0];
  int i;
  for (i = 0; i < 1; i++) {
    l_172[i] = &g_23;
  }
  **l_176 = func_16 (**l_176);
  printf ("%d\n", g_23);
  return 0;
}
regehr at home:~/volatile/bugs/tmp342$ clang -v
clang version 2.9 (trunk 120082)
Target: i386-pc-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