This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37102] New: possible integer codegen bug


This is for svn 139046 on Ubuntu Hardy.

regehr@john-home:~/volatile/tmp0$ current-gcc -O -Wall -fwrapv small.c -o small
regehr@john-home:~/volatile/tmp0$ ./small
5
regehr@john-home:~/volatile/tmp0$ current-gcc -O3 -Wall -fwrapv small.c -o
small
regehr@john-home:~/volatile/tmp0$ ./small
0
regehr@john-home:~/volatile/tmp0$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20080813 (experimental) (GCC) 
regehr@john-home:~/volatile/tmp0$ cat small.c

#include <stdio.h>

unsigned int g_24;
unsigned int g_37 = 1;
unsigned char g_225;

int main (void)
{
  int l_289;
  for (l_289 = 1; l_289 < 5; l_289 += 1) {
    if (g_225) {
      g_24 = g_37;
    }
  }
  g_24 = g_37;
  unsigned short context = g_24 << 1;
  do {
    if (context)
      context = (context << 1) ^ 1;
  } while (0);
  printf ("%d\n", (int)context);
  return 0;
}


-- 
           Summary: possible integer codegen bug
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37102


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]