[Committed] Fix subreg_promoted_mode breakage on various platforms
Christophe LYON
christophe.lyon@foss.st.com
Wed Sep 1 06:55:16 GMT 2021
On 31/08/2021 18:33, Roger Sayle wrote:
> My apologies for the inconvenience. My recent patch to preserve
> SUBREG_PROMOTED_VAR_P on (extend:HI (subreg/s:QI (reg:SI))), and other
> places in the middle-end, has broken the build on several targets.
>
> The change to convert_modes inadvertently used the same
> subreg_promoted_mode idiom for retrieving the mode of a SUBREG_REG
> as the existing code just a few lines earlier. Alas in the meantime,
> the original SUBREG gets replaced by one without SUBREG_PROMOTED_VAR_P,
> the whole raison-d'etre for my patch, and I'd not realized/noticed
> that subreg_promoted_mode asserts for this. Alas neither the bootstrap
> and regression test on x86_64-pc-linux-gnu nor my testing on nvptx-none
> must have hit this particular case. The logic of this transformation
> is sound, it's the implementation that's bitten me.
>
> This patch has been committed, after another "make bootstrap" on
> x86_64-pc-linux-gnu (just in case), and confirmation/pre-approval
> from Jeff Law that this indeed fixes the build failures seen on
> several platforms.
>
> My humble apologies again.
Thanks, I confirm it fixes the aarch64 build too. Sorry for the delay.
Christophe
>
> 2021-08-31 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> * expr.c (convert_modes): Don't use subreg_promoted_mode on a
> SUBREG if it can't be guaranteed to a SUBREG_PROMOTED_VAR_P set.
> Instead use the standard (safer) is_a <scalar_int_mode> idiom.
>
> Roger
> --
>
>
More information about the Gcc-patches
mailing list