This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix miscompilation in output_constant_def


On 11/06/2009 05:49 AM, Maxim Kuvyrkov wrote:
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.

Applied to 4.4 and mainline.



r~



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]