[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-05 Thread gcc at haasn dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #16 from Niklas Haas --- (In reply to Alexander Monakov from comment #15) > (In reply to Niklas Haas from comment #12) > > Out of curiosity, is there a work-around that I could use to get current > > versions of GCC to compile the ri

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org --- Com

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #14 from Jakub Jelinek --- (In reply to Richard Biener from comment #10) > (In reply to Jakub Jelinek from comment #9) > > Shouldn't we optimize this in match.pd when global range says it is ok or > > during vrp/evrp using local rang

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #13 from Richard Biener --- (In reply to Niklas Haas from comment #12) > Out of curiosity, is there a work-around that I could use to get current > versions of GCC to compile the right thing, but without breaking > cross-platform com

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread gcc at haasn dot dev via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #12 from Niklas Haas --- Out of curiosity, is there a work-around that I could use to get current versions of GCC to compile the right thing, but without breaking cross-platform compatibility? I did try replacing the assertion by "x

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #11 from Richard Biener --- Created attachment 60648 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60648&action=edit patch I'm testing this for GCC 16.

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #10 from Richard Biener --- (In reply to Jakub Jelinek from comment #9) > Shouldn't we optimize this in match.pd when global range says it is ok or > during vrp/evrp using local ranges? I mean turn the int shift into > {,un}signed {

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #9

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Richard Biener changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #7 from Richard Biener --- So first of all the range info on the shift is lost, so vect_recog_over_widening_pattern cannot do its work. The info is lost when PRE moves the invariant (int) amount cast out of the loop - we've dropped

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Richard Biener changed: What|Removed |Added Blocks||53947 Target|

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-03 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 --- Comment #5 from Hongtao Liu --- (In reply to Hongtao Liu from comment #4) > vect_recog_over_widening_pattern could be extended with range info for this? Looks like vectorizer already have range_info from vect_determine_precisions_from_range

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-03 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Hongtao Liu changed: What|Removed |Added CC||liuhongt at gcc dot gnu.org --- Comment #

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Andrew Pinski changed: What|Removed |Added Summary|Very suboptimal AVX2 code |shift not demotated when