This is the mail archive of the gcc@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]

objects_must_conflict_p


Hi,

This function (from alias.c) was added in the pre-3.0 timeframe and is used 
in only one place (in function.c) to determine whether a freed stack slot 
can be reused for a new temporary.

The comment says:
/* Return 1 if any MEM object of type T1 will always conflict (using the
   dependency routines in this file) with any MEM object of type T2.

I presume that the reasoning is, since the types conflict, operations on 
objects of these types cannot be reordered by the scheduling passes later.

The function takes great care of aggregate types, in particular returns 0 for 
scalar vs aggregate. But, ultimately, for aggregate vs aggregate it returns 
the value of alias_sets_conflict_p.


I think that's overly optimistic: what will ensure that an operation on a 
field of the first aggregate will always conflict with an operation on a 
field of the second aggregate, if they happen to be given the same address 
on the stack? Nothing I'd say, like in PR optimization/11198.

So, unless we want to recursively check that every member of the first 
aggregate conflicts with every member of the second aggregate that will 
overlap it on the stack, we should return 0 too for aggregate vs aggregate.

-- 
Eric Botcazou


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