PATCH: tree-ssa-sink breaks stack layout

Richard Guenther richard.guenther@gmail.com
Sun Apr 5 20:49:00 GMT 2009


On Sun, Apr 5, 2009 at 10:05 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> Richard Guenther wrote:
>
>> I agree with both of you.  May I suggest to provide our users with
>> a workaround, -fno-stack-slot-sharing, instead?
>
> Yes, a work-around (one that doesn't require turning on strict aliasing)
>  would be useful.  However, I think it would be better if we could find
> a way to paper this over by default so that fewer people notice the bug.

It is likely possible to paper over the issue for the testcase we have, but
this fix-this-single-testcase-with-a-workaround doesn't sound appealing
to me if we admittedly know other places in the compiler with exactly
the same issue ...

So, instead of trying to paper over this in tree-ssa-sink.c I would instead
suggest to detect "overlapping" scopes during cfgexpand and consider
them as merged for the purpose of stack slot sharing.  This will result
in less sharing but be a more robust fix.

> "code doesn't work; debug for a while; looks like compiler is broken;
> search web for work-around; rebuild with work-around" is not as as good
> an experience as "code works". :-)

Heh, but of course we have that all the time with answers like
"try -fno-strict-aliasing", "try -fwrapv", etc., so adding another one doesn't
sound too bad here.

>> As of a proper fix in the 4.5 timeframe - I suggest that organizations
>> consider assigning ressources to fixing this problem, it's unlikely going
>> to be a volunteers effort to implement for example the suggestion
>> of delaying stack slot allocation until after scheduling.
>
> Yes.  I can't make any promises, but I'll certainly look for
> opportunities for CodeSourcery to help.

Thanks,
Richard.



More information about the Gcc-patches mailing list