Bug 2550

Summary: postfix ++ doesn't work
Product: gcc Reporter: mikaldaz
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bernds, gcc-bugs
Priority: P3 Keywords: wrong-code
Version: 2.95.3   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description mikaldaz 2001-04-14 06:06:00 UTC

Release:
gcc version 2.95.3 20010315 (release)

Environment:
SuSE Linux 7.0 (for Sparc)
SUN UltraSparc 1 170

How-To-Repeat:
#include <stdio.h>

int main()
{
	int a = 10, b = 15;

	a = a++ + b;
	printf("%d\n", a);

	return 0;
}
Comment 1 mikaldaz 2001-04-14 06:06:00 UTC
Fix:
lets compile with optimization flags (-O1, -O2, -O3)
Comment 2 Bernd Schmidt 2001-04-17 05:11:12 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Not a bug in gcc.  The program's behaviour is undefined;
    "a" is modified twice without a sequence point in between.
Comment 3 Bernd Schmidt 2001-04-17 12:11:13 UTC
From: bernds@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, mikaldaz@unavarra.es, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/2550
Date: 17 Apr 2001 12:11:13 -0000

 Synopsis: postfix ++ doesn't work
 
 State-Changed-From-To: open->closed
 State-Changed-By: bernds
 State-Changed-When: Tue Apr 17 05:11:12 2001
 State-Changed-Why:
     Not a bug in gcc.  The program's behaviour is undefined;
     "a" is modified twice without a sequence point in between.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2550&database=gcc
Comment 4 Andrew Pinski 2005-04-20 02:54:39 UTC
Reopening to ...
Comment 5 Andrew Pinski 2005-04-20 02:54:53 UTC
Mark as a dup of bug 11751.

*** This bug has been marked as a duplicate of 11751 ***