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

Re: [patch] Fix type merging deficiency during WPA

> So something akin to what I initially proposed?

I have similar patch to add_expr. I don't think it should have flag_wpa guard:
other FEs are keeping umberged decls, too, just not as often as LTO.

I am not sure about operand_equal_p.  If one decl has warning on it and the
other doesn't we can't unify their uses even if assembler name is the same
because we may end up messing up the warning. I guess we need to wind up more
involved decl comparing here listing properties of decls that needs to match
and it may be bit fun determining which ones we want to support.
(naturally this is also important for ICF that is also currently wrong WRT
warning attributes)

I see that gimple_canonical_types_compatible_p winds up using operand_equal_p
on expressions which represent the array size and that is why you need
walk_simple_constant_arithmetic and operand_equal_p change. This seem conceptually
wrong because operand_equal_p is allowed to have false negatives, but not false
positives. For TBAA purposes we can tolrate false positives, but no false negatives.

I wonder how much code quality we would lose by simply treating only constantly
sized arrays and considering all VLAs of the same type to be compatible?
There are interesting issues WRT C standard and the canonical types of arrays have
just secondary role (i.e. they are hardly used by themselves and only are used
to compute canonical types of structures) and there may be lower hanging fruits
in TBAA improvement than trying to handle sturctures containng VLAs right.


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