[LLVMbugs] [Bug 2539] New: possible integer codegen error

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jul 10 09:32:41 PDT 2008


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

           Summary: possible integer codegen error
           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


>From svn 53390 on Ubuntu Feisty on ia32.

[regehr at babel tmp2]$ llvm-gcc -O1 -fwrapv small.c -o small
[regehr at babel tmp2]$ ./small
1
[regehr at babel tmp2]$ llvm-gcc -O2 -fwrapv small.c -o small
[regehr at babel tmp2]$ ./small
0

[regehr at babel tmp2]$ cat small.c
#include <stdint.h>
#include <stdio.h>

static inline unsigned long int
mod_rhs(const long int rhs)
{
    if (rhs == 0) return 1;
    return rhs;
}

int16_t g_6;
uint8_t g_155;
int8_t g_156;

int32_t func_87 (void);
int32_t func_87 (void)
{
  return 1;
}

int32_t func_146 (void);
int32_t func_146 (void)
{
  int8_t p_147;
  for (p_147 = 0; 1; p_147 -= 1)

    if (p_147 >= ((func_87 ()) < (p_147 % mod_rhs (g_155))))
      {
        g_156 = 1;
        for (p_147 = 1; p_147; p_147 += 1)
          return 1;
      }
    else
      return 1;  
}

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