[LLVMbugs] [Bug 3029] New: possible integer miscompilation

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Nov 8 21:34:01 PST 2008


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

           Summary: possible integer miscompilation
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


Perhaps this is the same as 2999 or 3018, I cannot tell.

This is seen on r58928 on Ubuntu Hardy on x86.

regehr at john-home:~/volatile/tmp59$ llvm-gcc -O1 small.c -o small
regehr at john-home:~/volatile/tmp59$ ./small
1
regehr at john-home:~/volatile/tmp59$ llvm-gcc -O2 small.c -o small
regehr at john-home:~/volatile/tmp59$ ./small
0
regehr at john-home:~/volatile/tmp59$ cat small.c

#include <stdio.h>

unsigned g_102;
volatile unsigned g_138;
int g_188;
unsigned g_207;

int func_119 (void);
int func_119 (void)
{
  return g_138;
}

void func_110 (int p_111);
void func_110 (int p_111)
{
  unsigned l_192 = 0xA2471E60L;
  if (l_192 < g_188) {
    func_119 ();
  }
  else {
    g_207 = 1;
  }
}

void func_34 (void);
void func_34 (void)
{
  for (g_188 = 0; g_188 < 2; g_188++) {
    func_110 (1);
  }
}

int main (void)
{
  func_34 ();
  printf ("%d\n", g_207);
  return 0;
}


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