On 8/26/26 1:55 PM, Matt Turner wrote:
Without target patterns, the generic stack protector expansion moves the
canary through ordinary pseudos, which the register allocator is free to
spill or to keep live across the whole function. Describe the set and
the test as single, unsplittable insns that clear their scratch registers
on the way out, so that the canary value exists in a register for only
the few instructions that need it. This matches what riscv, sparc,
aarch64 and others already do.
__stack_chk_guard's address is not a valid memory address on Alpha, and
gentarget-def calls gen_stack_protect_set directly without checking the
expander's predicates, so the expanders legitimize it themselves. Only
the address is placed in a pseudo, never the canary.
gcc/ChangeLog:
* config/alpha/alpha.md (UNSPEC_SSP_SET, UNSPEC_SSP_TEST): New
unspecs.
(stack_protect_set, stack_protect_setdi): New patterns.
(stack_protect_test, stack_protect_testdi): Likewise.
gcc/testsuite/ChangeLog:
* gcc.target/alpha/stack-protector-1.c: New test.
I've pushed this to the trunk too. My tester is just about done with
this week's alpha run, so all the alpha changed pushed in the last
~12hrs will get tested in next week's run.
Thanks again,
jeff