Bug 2550 - postfix ++ doesn't work
Summary: postfix ++ doesn't work
Status: RESOLVED DUPLICATE of bug 11751
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 2.95.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2001-04-14 06:06 UTC by mikaldaz
Modified: 2005-04-20 02:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***