[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 --- Comment #7 from Richard Biener --- Author: rguenth Date: Wed Jul 13 13:57:05 2016 New Revision: 238299 URL: https://gcc.gnu.org/viewcvs?rev=238299=gcc=rev Log: 2016-07-13 Richard Biener PR

[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 Richard Biener changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-13 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 --- Comment #5 from Marc Glisse --- (In reply to rguent...@suse.de from comment #4) > Yeah, but folding would happily create undefined behavior from, say, > > if (x != INT_MIN) >x = x * -1; > > as folding folds INT_MIN * -1 to INT_MIN

[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-13 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 --- Comment #4 from rguenther at suse dot de --- On Tue, 12 Jul 2016, glisse at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 > > --- Comment #3 from Marc Glisse --- > Makes sense, I don't know why I didn't add

[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 --- Comment #3 from Marc Glisse --- Makes sense, I don't know why I didn't add divisions in the original patch. *_MOD_EXPR, shifts and rotates should work as well with 0 on the left, max with INT_MAX, etc, I was quite minimalist there. Of

[Bug tree-optimization/24574] a!=0?a/10:0 is not reduced to a/10

2016-07-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24574 Richard Biener changed: What|Removed |Added CC||rguenth at gcc dot gnu.org --- Comment