https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122999
Christophe Lyon <clyon at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clyon at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2025-12-04
--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> ---
It seems I reproduced it with your 1st reproducer.
This happens with:
*op0 = (lt (reg:CC 80 cc)
(const_int 0 [0]))
and *op1 = (const_int 0 [0])
in which case both have VOIDmode, which has GET_MODE_BITSIZE (mode) == 0
In that case, arm_canonicalize_comparison exits at:
/* Comparisons smaller than DImode. Only adjust comparisons against
an out-of-range constant. */
and does not need/use maxval, so it seems "safe".
Perhaps we could move this early exit before computing maxval, provided we add
a check that mode is actually "smaller than DImode" ?