[PATCH] Fix miscompilation in output_constant_def

Richard Henderson rth@redhat.com
Fri Nov 13 19:59:00 GMT 2009


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~



More information about the Gcc-patches mailing list