On 7/4/25 10:21 AM, Richard Sandiford wrote:
ext-dce had:
if (SUBREG_P (dst) && SUBREG_BYTE (dst).is_constant ())
{
bit = subreg_lsb (dst).to_constant ();
if (bit >= HOST_BITS_PER_WIDE_INT)
bit = HOST_BITS_PER_WIDE_INT - 1;
dst = SUBREG_REG (dst);
But a constant SUBREG_BYTE doesn't guarantee a constant subreg_lsb.
If the SUBREG_REG is a pair of N-bit registers on a big-endian target,
the most significant end has a SUBREG_BYTE of 0 but a subreg_lsb of N.
This N would then be non-constant for variable-length registers.
The patch fixes gcc.dg/torture/pr120276.c and other failures on
aarch64_be-elf.
Tested on aarch64-linux-gnu & aarch64_be-elf. OK to install?
Richard
gcc/
* ext-dce.cc (ext_dce_process_uses): Apply is_constant directly
to the subreg_lsb.
OK, of course.
Makes me wonder if I should resurrect my aarch64_be RFS. I changed how
those systems worked in the system a few years back to make it work
better with container based testing rather than direct chroots. I never
converted aarch64_be to that setup. It shouldn't be hard if you think
it's valuable. I can't think of another system where we'd these kinds
of issues.
Jeff