https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118638
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 60291
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60291&action=edit
gcc15-pr118638.patch
Untested fix.
Note, for GCC 16 I think we should extend this, also handle multiplication by
(1 << x) + 1 for x >= len, because when extracting the low len bits, the
multiplication by 1 << x will leave all len bits 0 and so it really is just
extraction of the len bits from the other MULT operand.
Which is why I've left the len > 1 check in the inner if rather than outer.