User account creation filtered due to spam.

Bug 816 - function parameters incorrect order when using ++ as a parameter
Summary: function parameters incorrect order when using ++ as a parameter
Status: RESOLVED DUPLICATE of bug 11751
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-11-15 13:16 UTC by super.aorta
Modified: 2004-08-13 16:03 UTC (History)
2 users (show)

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


Attachments
test1.cc (308 bytes, application/octet-stream)
2003-05-21 15:16 UTC, super.aorta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description super.aorta 2000-11-15 13:16:01 UTC
Compiler generates unexpected code when the ++ command is 
used in function parameters.  The compiler seems to reverse
the order of the parameters (see code it is much easier to
view, than to describe)

I don't know if this is C++ legal to do this, but it is 
the reverse of everything I am used to and a bit irritating.  
I will download the latest version of g++ and test it 
(manana).

I don't know if it even belongs to g++ yet.
Thanks m
NOT present in g++ gcc version 2.8.1.

Release:
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

Environment:
Linux substitute 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown

How-To-Repeat:
// UNDER 2.91.66 with BUG
g++ test1.cc -o test1
test1
This is matts compiler test program 1
6 5 4 3 2 1             // incorrect
This is test_fun
6 5 4 3 2 1             // incorrect
This is test_fun
6 5 4 3 2 1             // incorrect
This is test_fun
1 2 3 4 5 6             // correct
This is test_fun
1 2 3 4 5 6     
// correct
// BY COMPARISON
// UNDER 2.8.1 with NO BUG
test1
 This is matts compiler test program 1
1 2 3 4 5 6
This is test_fun
1 2 3 4 5 6
This is test_fun
1 2 3 4 5 6
This is test_fun
1 2 3 4 5 6
This is test_fun
1 2 3 4 5 6      
// correct every time!
Comment 1 super.aorta 2000-11-15 13:16:01 UTC
Fix:
Can code around it and maybe fixed in newer g++, 
can't find it in the bug list.
Comment 2 Nathan Sidwell 2000-11-17 08:51:36 UTC
State-Changed-From-To: open->closed
State-Changed-Why: you've invoked undefined effects. There are no sequence
    points between evaluating function arguments.
Comment 3 Nathan Sidwell 2000-11-17 16:51:36 UTC
From: nathan@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, super.aorta@ntlworld.com
Cc:  
Subject: Re: c++/816
Date: 17 Nov 2000 16:51:36 -0000

 Synopsis: function parameters incorrect order when using ++ as a parameter
 
 State-Changed-From-To: open->closed
 State-Changed-By: nathan
 State-Changed-When: Fri Nov 17 08:51:36 2000
 State-Changed-Why:
     you've invoked undefined effects. There are no sequence
     points between evaluating function arguments.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=816&database=gcc
Comment 4 Wolfgang Bangerth 2004-08-13 16:01:37 UTC
Reopening to mark as a duplicate of... 
Comment 5 Wolfgang Bangerth 2004-08-13 16:03:12 UTC
...PR 11751. 

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