Aliasing patch for tree-optimization/28778

Daniel Berlin dberlin@dberlin.org
Sat Aug 26 21:51:00 GMT 2006


Mark Mitchell wrote:
> Daniel Jacobowitz wrote:
>> On Sat, Aug 26, 2006 at 01:54:09PM -0400, Daniel Berlin wrote:
>>> Unfortunately, this is going to be a mild pain in the ass to fix, and
>>> require some escaping rewrite.
>>>
>>> I'll take care of it, but it might be better to put off till 4.3
>> I'll let release-y people sort it out, but given the bug, that seems
>> like a bad idea to me.
> 
> I think this is exactly the sort of issue that should be fixed for 4.2. 
>   There's nothing particularly weird about this code, it doesn't use any 
> GNU extensions, it looks to have come from real-world code, and it 
> affects multiple common targets.  So, I think the P1 marker is reasonable.
> 

I don't disagree, I just don't believe the size of the change it will
take to fix this (probably about 500-1000 lines), and how it is going to
affect core infrastructure, is really something that should be in stage3.

> A conservative fix is certainly worth considering;

There is no correct, simple, conservative fix here that isn't "assume
everything is call clobbered everywhere".

We simply don't have the links between the cast and the escaping in a
way that tells us what is really call clobbered here.

Building that is much like building a simpler version of
tree-ssa-structalias.c that solves this dataflow problem.

I'm not sure you want to redo the entire escaping infrastructure for 4.2
in stage 3.

>  if we can't get exact 
> information, falling back to less-exact information might be an 
> acceptable intermediate state.

If I believed this was possible in a way that wouldn't break in some
other testcase, i'd suggest such a way.

Saying that things that point to anything are call clobbered would fix
this testcase, but would still be broken in a variant of this testcase
where we know the points-to set.  TBAA would still prune it out of the
set of aliases, as it should.

This bug has been around since 4.0 since tree level had aliasing and
call clobber:).  IMHO, it makes more sense to release 4.2 with it in it,
and fix it for 4.3 stage1, than it does to make what will be a large
change in 4.2.

But you are the release manager, so if you want me to write up something
to fix this correctly, i will do it for 4.2. It will take about 2 weeks
though, as i can't do it during work hours right now (google assignment
issues).

--Dan



More information about the Gcc-patches mailing list