[Bug c/12569] New: Incorrect result on pathological code
s0094247 at sms dot ed dot ac dot uk
gcc-bugzilla@gcc.gnu.org
Fri Oct 10 14:57:00 GMT 2003
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.
More information about the Gcc-bugs
mailing list