[Bug c/42052] New: Incorrect code generated for cast to lvalue with post increment

rajamukherji at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Nov 15 18:56:00 GMT 2009


gcc 4.4.1 generates incorrect code for the following type of expression:

void *P;

for (something) {
    ...
    *((*(int **)&P)++) = Value;
    ...
};

P remains unchanged throughout the loop.

This code worked correctly in earlier versions of gcc, last checked on gcc
4.3.2.

the following flags were used:
-std=gnu99 -fdata-sections -ffunction-sections -pipe -O2 -fomit-frame-pointer
-w -D_GNU_SOURCE -fexpensive-optimizations


-- 
           Summary: Incorrect code generated for cast to lvalue with post
                    increment
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rajamukherji at gmail dot com
GCC target triplet: i486-linux-gnu


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



More information about the Gcc-bugs mailing list