[Bug c/61317] New: ones complement fails when using increment(++) into an array

richard at rjriley dot info gcc-bugzilla@gcc.gnu.org
Mon May 26 08:55:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61317

            Bug ID: 61317
           Summary: ones complement fails when using increment(++) into an
                    array
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard at rjriley dot info

Created attachment 32855
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32855&action=edit
Test program and results

When taking the one's complement of a number with the result going to an array
using an auto-incremented index, the new gcc produces incorrect values.

ints[j++]=~ints[j-1] & 0xFF; does not produce the same (correct) value as 
a = ~ints[j-1] & 0xFF; ints[j++] = a;



More information about the Gcc-bugs mailing list