[Bug tree-optimization/126644] `a << CST >> CST` can be simplified into a if upper CST bits are not set

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]> Wed, 05 Aug 2026 00:34:48 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126644

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
>Could do some gimple_match_range_of_expr.

Yes and no; you can just use tree_nonzero_bits (which will call
get_nonzero_bits).

tree_nonzero_bits handles vectors (in some cases) and pointers.