This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: tree-ssa-sink breaks stack layout
Richard Guenther wrote:
>> Do we? Again, that's not a rhetorical question; I don't know the
>> answer. Do we have other test-cases showing this problem with other
>> passes?
>
> I have created tens of testcases showing PTA analysis bugs, I think
> it would be not difficult to create testcases that break with tree
> loop invariant/store motion and with PRE (just to name the two
> obvious candidates).
All right. I'm not surprised, but I hadn't seen the problem come up
with these optimizations.
> I suggest to merge all overlapping scopes, not just detect if variable
> accesses have been migrated outside their scope (that's not easy - if
> you just move a stmt its lexical block does not change, instead if
> you scan stmts looking for out-of-order (or unknown) blocks for stmts
> then you know sth bad may have happened)
That sounds plausible. This is just checking GIMPLE_STMT_BLOCK, right?
> True. But there are a lot of existing wrong-code bugs in released compilers
> (with small testcases). It's not that we can fix everything, but providing
> a reasonable workaround like -fno-strict-aliasing is something we should
> make sure exists (no, I don't really consider -O0 an acceptable workaround).
I agree; we can't fix everything, and work-arounds are good. But, if we
can do something like what you're suggesting above to avoid the problem,
that's even better.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713