[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-09-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #18 from Marc Glisse --- (In reply to Gergö Barany from comment #17) > the division used to be replaced by a shift that updated the condition code > register (again, on ARM; r250337): (just my opinion) At a high level (gimple),

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-09-14 Thread gergo.barany at inria dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #17 from Gergö Barany --- Thanks for fixing this. I did notice a small thing that might be considered a tiny regression due to the fix. If the divisor is a small power of 2, as in the following example: int fn1(char p1) { long a;

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 Jakub Jelinek changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #15 from Jakub Jelinek --- Author: jakub Date: Wed Jul 19 13:10:05 2017 New Revision: 250342 URL: https://gcc.gnu.org/viewcvs?rev=250342=gcc=rev Log: PR tree-optimization/81346 * match.pd: Optimize (X - 1U) <=

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #14 from Jakub Jelinek --- Author: jakub Date: Wed Jul 19 12:31:59 2017 New Revision: 250338 URL: https://gcc.gnu.org/viewcvs?rev=250338=gcc=rev Log: PR tree-optimization/81346 * fold-const.h (fold_div_compare,

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-18 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #13 from Marc Glisse --- (In reply to Jakub Jelinek from comment #12) > Created attachment 41781 [details] > gcc8-pr81346-2.patch > > Further optimization from build_range_check. I wonder if "1" is that special, this optimization

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #12 from Jakub Jelinek --- Created attachment 41781 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41781=edit gcc8-pr81346-2.patch Further optimization from build_range_check.

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 Jakub Jelinek changed: What|Removed |Added Attachment #41760|0 |1 is obsolete|

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #10 from Marc Glisse --- (In reply to Jakub Jelinek from comment #9) > (In reply to Marc Glisse from comment #8) > > I think always using an unsigned type for the range check would be simpler. > > If we try to check that x>=INT_MIN+2

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #9 from Jakub Jelinek --- (In reply to Marc Glisse from comment #8) > I think always using an unsigned type for the range check would be simpler. > If we try to check that x>=INT_MIN+2 && x<=INT_MAX-2 with -fwrapv, int is > still not

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #8 from Marc Glisse --- I think always using an unsigned type for the range check would be simpler. If we try to check that x>=INT_MIN+2 && x<=INT_MAX-2 with -fwrapv, int is still not a suitable type in which to do

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 Jakub Jelinek changed: What|Removed |Added Attachment #41707|0 |1 is obsolete|

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #6 from Marc Glisse --- (In reply to Jakub Jelinek from comment #5) > Untested WIP patch. Still no idea how to handle the build_range_check stuff > at GIMPLE, that function is pretty huge. Shall I just always generate the > cast to

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #5 from Jakub Jelinek --- Created attachment 41707 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41707=edit gcc8-pr81346-wip.patch Untested WIP patch. Still no idea how to handle the build_range_check stuff at GIMPLE, that

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 Jakub Jelinek changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org ---

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-07 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-06 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #2 from Andrew Pinski --- Most likely the optimization is in fold-const.c and has not been moved to match.pd yet.

[Bug tree-optimization/81346] Missed constant propagation into comparison

2017-07-06 Thread gergo.barany at inria dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81346 --- Comment #1 from Gergö Barany --- Sorry, forgot to add the command line. I use gcc -O3 on all platforms