https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #8 from Richard Biener ---
Where I get for the testcase
int z = 0;
int a = 1, 0;
return a;
for some odd reason (1?! ... fold_ignored_results fault...)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #7 from Richard Biener ---
Like a more complete variant of
Index: gcc/tree.c
===
--- gcc/tree.c (revision 223151)
+++ gcc/tree.c (working copy)
@@ -4402,6 +4402,11 @@
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #6 from Richard Biener ---
I think the proper solution is to mark all problematic operations with
TREE_SIDE_EFFECTS so that the side-effects are preserved when omitting
operands.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
Marek Polacek changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #4 from Richard Biener ---
Note that the inconsistent handling of */% 0 has been 1:1 translated from
fold-const.c (also the comments).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #3 from Marek Polacek ---
I suppose this particular issue might be even relevant to e.g.
-mcheck-zero-division on MIPS, i.e. everywhere where we're expect to trap on
integer division by zero.
(ubsan's -fsanitize=integer-divide-by-zer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
Manuel López-Ibáñez changed:
What|Removed |Added
CC||manu at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #1 from joseph at codesourcery dot com ---
Ideally the front-end folding of expressions-of-constants might avoid
folding-for-optimization such as this (instead just folding cases where
the evaluated operands are actually constants,