https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
--- Comment #6 from Tobias Burnus ---
Crossref: New Bug 11 is for the range analysis to deduce from 'x << a' that
'a' must be nonnegative.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
--- Comment #4 from Richard Biener ---
all same for right-shifts (both logical and arithmetic).
Note that 1 << (a + 5) might be cheaper than (1<<5) << a due to constraints
on immediates but for GIMPLE the latter is definitely more canonical.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
--- Comment #3 from Tobias Burnus ---
As we want to have a >= 0, I tried to convey it differently for the example in
comment 0:
(a) __attribute__((assume(ch >= 0)));
(b) 'unsigned ch' (instead of 'int ch')
but it didn't help. Thus, it looks a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
--- Comment #2 from Tobias Burnus ---
> Thus we need some range info to do this optimization.
Good point.
It seems as if for c1 << (c2 * a + c3), C requires a >= -c3/c2 (read as float
division; c2 ≠ 0)
And the suggested optimization requires
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115551
Xi Ruoyao changed:
What|Removed |Added
CC||xry111 at gcc dot gnu.org
--- Comment #1 fr