Richard Henderson wrote:
On 11/04/2009 10:26 AM, Maxim Kuvyrkov wrote:
/* Avoid expand_expr here, because we don't want guard_decl pulled
into registers unless absolutely necessary. And we know that
crtl->stack_protect_guard is a local stack slot, so this skips
all the fluff. */
x = validize_mem (DECL_RTL (crtl->stack_protect_guard));
y = validize_mem (DECL_RTL (guard_decl));
Ah, that's what we get for premature optimization.
Probably best to push this through expand_expr rather than manually
calling copy_rtl here.
I've tested the attached patch applied to gcc-4.4 on i686-linux and
x86_64-linux architectures (gcc, g++ and libstdc++ testsuites) without
any regressions. All the tests were run with -fstack-protector.
Richard, the patch merely implements your suggestion, so feel free to
check it in yourself.