This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix type merging deficiency during WPA
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>
- Date: Tue, 12 Jul 2016 01:32:17 +0200
- Subject: Re: [patch] Fix type merging deficiency during WPA
- Authentication-results: sourceware.org; auth=none
- References: <1644035.nvA1iejZSU@polaris> <1984635.2VDvgg1PtU@polaris> <20160711151442.GB96967@kam.mff.cuni.cz> <2168779.soFkMKOpE0@polaris>
> 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
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.