[Bug target/122999] [16 Regression] arm: runtime error: in arm_canonicalize_comparison ../../trunk/gcc/config/arm/arm.cc:5703

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 5 17:01:19 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122999

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Earnshaw <rearnsha@gcc.gnu.org>:

https://gcc.gnu.org/g:c48b55fa7764477008fbf187fadb352e3391a3f5

commit r16-5914-gc48b55fa7764477008fbf187fadb352e3391a3f5
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Fri Dec 5 14:34:38 2025 +0000

    arm: avoid invalid shift in arm_canonicalize_comparison [PR122999]

    There was UB in arm_canonicalize_comparison if it is called with
    both operands of type VOIDmode.  Avoid this by first handling
    floating-point types, then returning if we are left with anything
    other than an integer mode.  For belt-and-braces also check that
    the mode does not require a mask larger than HOST_WIDE_INT.

    gcc/ChangeLog:

            PR target/122999
            * config/arm/arm.cc (arm_canonicalize_comparison): Defer
            initializing maxval until we know we are dealing with an
            integer mode.


More information about the Gcc-bugs mailing list