This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12569] New: Incorrect result on pathological code
- From: "s0094247 at sms dot ed dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2003 14:57:53 -0000
- Subject: [Bug c/12569] New: Incorrect result on pathological code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.