https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124495
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:9a72a88b4a5f4c271e78e6ff3ddc76e793dfa69c commit r17-3001-g9a72a88b4a5f4c271e78e6ff3ddc76e793dfa69c Author: Matt Turner <[email protected]> Date: Wed Aug 5 21:02:38 2026 -0600 [PATCH 2/2] alpha: keep the exception receiver's gpdisp pair together [PR124495] exception_receiver and builtin_setjmp_receiver split into an ldah/lda pair that shares a !gpdisp relocation sequence number, so the two insns have to stay in 1-1 correspondence. The first half is an unspec_volatile (*ldgp_er_1), but the second half was a plain unspec (*ldgp_er_2), which makes the halves unequally deletable: once the landing pad turns out not to use $29, the DCE run at the start of the peephole2 pass removes the lda and leaves the ldah behind. The assembler then rejects the result: Error: No lda !gpdisp!1188 was found Compiling C++ with -fassume-sane-operators-new-delete, which is the default, makes this much easier to hit, since it lets more of the cleanup code in a landing pad be optimized away. Add an unspec_volatile variant of *ldgp_er_2 and use it for both receivers. The gpdisp pair emitted after a call needs no such treatment: there the ldah is part of the call insn and both halves are plain unspecs, so they are deleted together. gcc/ChangeLog: PR target/124495 * config/alpha/alpha.md (UNSPECV_LDGP2): New unspec_volatile. (*ldgp_er_2_v): New insn. (*builtin_setjmp_receiver_1): Split the second half of the gpdisp pair to it instead of *ldgp_er_2. (*exception_receiver_1): Ditto. gcc/testsuite/ChangeLog: PR target/124495 * g++.target/alpha/pr124495.C: New test.
