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/12569] New: Incorrect result on pathological code


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Incorrect result on pathological code
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s0094247 at sms dot ed dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org

int a;
a = 2;
printf ("%d\n", --a + a++); /* Should be 2, produces 2 */
a = 2;
printf ("%d\n", a++ + --a); /* Should be 4, produces 2 */
if ((--a + a++) == (a++ + --a))
    printf ("This bit however does not get executed\n");

Yes it's pathological but could be indicative of something worse.


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