[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread rguenth at gcc dot gnu.org
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...)

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread rguenth at gcc dot gnu.org
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 @@

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread rguenth at gcc dot gnu.org
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.

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread rguenth at gcc dot gnu.org
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).

[Bug middle-end/66127] Division by zero gets folded away

2015-05-12 Thread mpolacek at gcc dot gnu.org
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

[Bug middle-end/66127] Division by zero gets folded away

2015-05-12 Thread manu at gcc dot gnu.org
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

[Bug middle-end/66127] Division by zero gets folded away

2015-05-12 Thread joseph at codesourcery dot com
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,