[LLVMbugs] [Bug 3115] New: clang integer miscompilation

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Nov 22 21:11:00 PST 2008


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

           Summary: clang integer miscompilation
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: AST
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


Seen using r59898 on Ubuntu Hardy on x86.

The program below should print 1 instead of 0.

regehr at john-home:~/volatile/tmp61$ clang small.c -I/usr/include --emit-llvm -o
- | llvm-as | llc | as -o small.o ; gcc small.o -o small
regehr at john-home:~/volatile/tmp61$ ./small
0
regehr at john-home:~/volatile/tmp61$ cat small.c
#include <stdio.h>

unsigned int g_122;

int func_1 (void);
int func_1 (void)
{
  unsigned int l_19 = 1;
  if (1 ^ l_19 && 1) return 0;
  return 1;
}

int
main (void)
{
  printf ("%d\n", func_1());
  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