https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85344
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Segher Boessenkool from comment #11) > (In reply to Andrew Pinski from comment #8) > > Note this is documented in the internals documentation. > > What is? "We have a bug here"? I doubt it. https://gcc.gnu.org/onlinedocs/gccint/Constants.html#index-const_005fint Constants generated for modes with fewer bits than in HOST_WIDE_INT must be sign extended to full width (e.g., with gen_int_mode). For constants for modes with more bits than in HOST_WIDE_INT the implied high order bits of that constant are copies of the top bit. Note however that values are neither inherently signed nor inherently unsigned; where necessary, signedness is determined by the rtl operation instead.