Bug 48099 - Evaluation order of arguments in a call expression
Evaluation order of arguments in a call expression
Status: RESOLVED WONTFIX
Product: gcc
Classification: Unclassified
Component: middle-end
4.6.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-12 22:51 UTC by Iain Buclaw
Modified: 2014-10-11 07:02 UTC (History)
1 user (show)

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


Attachments
diff for 48099 (619 bytes, patch)
2011-03-12 22:52 UTC, Iain Buclaw
Details | Diff
corrected diff for 48099 (622 bytes, patch)
2011-03-12 22:56 UTC, Iain Buclaw
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Iain Buclaw 2011-03-12 22:51:20 UTC
Using flag_evaluation_order instead of PUSH_ARGS_REVERSE in gimplify_call_expr shouldn't have any effect on the actual order arguments are actually written, and gives correct behaviour for frontends that require left-to-right evaluation of arguments in a call expression. ie:

  i = 1;
  foo(i++, i++, i++); // foo(1,2,3)

Regards
Comment 1 Iain Buclaw 2011-03-12 22:52:59 UTC
Created attachment 23639 [details]
diff for 48099
Comment 2 Iain Buclaw 2011-03-12 22:56:20 UTC
Created attachment 23640 [details]
corrected diff for 48099

(In reply to comment #1)
> Created attachment 23639 [details]
> diff for 48099

Should be !flag_evaluation_order, sorry.
Comment 3 Andrew Pinski 2013-11-10 05:20:33 UTC
What front-end requires flag_evaluation_order now?
Comment 4 Richard Biener 2014-03-28 09:37:00 UTC
Java.
Comment 5 Andrew Pinski 2014-03-28 11:23:18 UTC
(In reply to Richard Biener from comment #4)
> Java.

Even with the removal of the Java source compiler (the byte code one should be safe enough).
Comment 6 Iain Buclaw 2014-10-11 07:02:46 UTC
> What front-end requires flag_evaluation_order now?

The D front-end.

A PR has been raised to fix this in upstream frontend implementation.