https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120242
Jeffrey A. Law <law at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|rsandifo at gcc dot gnu.org | --- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> --- So after 2 years, it's finally come back to bite us... The real regression is from this: Vineet/Robin, y'all will certainly remember this gem: commit 8eb9cdd142182aaa3ee39750924bc0a0491236c3 Author: Vineet Gupta <vine...@rivosinc.com> Date: Mon Oct 16 21:59:09 2023 -0600 expr: don't clear SUBREG_PROMOTED_VAR_P flag for a promoted subreg [target/111466] RISC-V suffers from extraneous sign extensions, despite/given the ABI guarantee that 32-bit quantities are sign-extended into 64-bit registers, meaning incoming SI function args need not be explicitly sign extended (so do SI return values as most ALU insns implicitly sign-extend too.) [ ... ] We've got a bogus promoted state which is interacting badly with combine. We weren't ever to find a test for the old code back when we dug into this problem, but we've got one now....