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 tree-optimization/34065] New: Inconsistency in test


The following program prints "foobar" 10 times:

#include <stdio.h>

unsigned int x = -10;

int main()
{
  for (;;)
    if (x == -1)
      break;
    else {
      printf("foobar\n");
      x++;
    }
  return 0;
}

However, when replacing "unsigned int x" by "unsigned char x" or "unsigned
short x", it prints "foobar" indefinitely. When using a bigger type (such as
"long long"), it prints it 10 times again.


-- 
           Summary: Inconsistency in test
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sam at rfc1149 dot net
  GCC host triplet: i686-pc-linux-gnu


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


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