The following test code incorrectly generates an assertion failure on gcc 
mainline and 4.0.1:

#include <assert.h>

struct fbs {
  unsigned char uc8;
} fbs1 = {255};

void testfn ( struct fbs *fbs_ptr )
{
  if ((fbs_ptr->uc8 != 255) && (fbs_ptr->uc8 != 0))
    assert(0);
}

int main (int argc, char *argv[])
{
  testfn (&fbs1);
  return 0;
}

-- 
           Summary: Invalid code generated for comparison of uchar to 255
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jconner at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin8.2.0
  GCC host triplet: powerpc-apple-darwin8.2.0
GCC target triplet: arm-none-elf


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

Reply via email to