[Bug ipa/65270] [5 regression] ICF needs to match TYPE attributes on memory accesses

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Tue Mar 3 14:57:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 2 Mar 2015, hubicka at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270
> 
> --- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Thanks 
> for looking into this! I think this was just the most obvoious of TYPE 
> flags. Some more we need to look into:
> 
> Is the alias class compare enough to handle TYPE_RESTRICT?

No.  But you can't compare restrict qualification by looking at a memory
reference pair from function A and function B.  You'd have to compare
all data dependences somehow.

You could get some cases by comparing function parameter types specially
(but global vars also have an issue, as well as decl-by-reference
aggregate parameters).

> We probably want to match TYPE_ADDR_SPACE of accesses as that affect codegen?

Well, that should be handled already by comparing MEM_REF operands
via types_compatible_p.

> We apparently need to match TYPE_ATTRIBUTES on functions, because we 
> check that flags on calees so we can not freely redirect them. Will fix 
> that.
>
> Also I think TYPE_STRING_FLAG may affect expand_builtin_classify_type that
> probably ought to be done at folding time during early opts?

classify-type is folded by frontends I think

> TYPE_NEEDS_CONSTRUCTING is used by ipa-pure-const but I think the use is 
> wrong (i.e. if decl needs to be constructed we will drop the readonly 
> flag)

Also sounds frontendish or gimplifyish

> TYPE_NONALIASED_COMPONENT seems to affect alias.c in some way.

Yes.  Similar to DECL_NONADDRESSABLE.  Both are used only by Ada.

> TYPE_FINAL_P also can not be mixed in virtual tables.

It seems to me that ICF isn't quite ready for prime time.  Let's disable
it by default for now, ok?



More information about the Gcc-bugs mailing list