[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2023-08-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |7.0

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 --- Comment #7 from Marek Polacek --- Author: mpolacek Date: Tue Apr 26 11:32:26 2016 New Revision: 235438 URL: https://gcc.gnu.org/viewcvs?rev=235438&root=gcc&view=rev Log: Bootstrapped/regtested on x86_64-linux, ok for trunk? 2016-04-25 Mar

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 --- Comment #6 from Marek Polacek --- You're right. Of course - in C++, ++i and --i are considered lvalues, while i++ and i-- are not.

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-21 Thread donald.chai at synopsys dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 --- Comment #5 from Donald Chai --- For what it's worth, post-increments behave as I would expect: $ cat test.c int main() { int x = 1; x++ ?: 0xbeef; return x; } $ gcc-5 -x c test.c; ./a.out; echo $? 2 $ gcc-5 -x c++ test.c; ./a.out

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 --- Comment #4 from Marek Polacek --- A possible fix seems to be --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4255,6 +4255,12 @@ stabilize_reference (tree ref) volatiles. */ return stabilize_reference_1 (ref); +case POSTDECREMENT_EXPR:

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 --- Comment #3 from Marek Polacek --- So build_conditional_expr_1 has 4626 /* As a G++ extension, the second argument to the conditional can be 4627 omitted. (So that `a ? : c' is roughly equivalent to `a ? a : 4628 c'.) If the

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED CC|

[Bug c++/70744] preincrements possibly double-evaluated in GNU ternaries

2016-04-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744 Richard Biener changed: What|Removed |Added Keywords||wrong-code Status|UNCONFIRM