]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Committed] Fix subreg_promoted_mode breakage on various platforms.
authorRoger Sayle <roger@nextmovesoftware.com>
Tue, 31 Aug 2021 16:25:58 +0000 (17:25 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Tue, 31 Aug 2021 16:25:58 +0000 (17:25 +0100)
commit863d6524f320abe14d6993fec188e787470e69b6
tree6c47398649c01632db13dd5f6d2955363fa2b60e
parent17dc903ed36ea0b6189d66a36d36e0c5ab803a7b
[Committed] Fix subreg_promoted_mode breakage on various platforms.

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.

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.
gcc/expr.c