This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix type merging deficiency during WPA
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>
- Date: Tue, 12 Jul 2016 09:18:30 +0200
- Subject: Re: [patch] Fix type merging deficiency during WPA
- Authentication-results: sourceware.org; auth=none
- References: <1644035.nvA1iejZSU@polaris> <2168779.soFkMKOpE0@polaris> <20160711233217.GA93872@kam.mff.cuni.cz>
> 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.
Not just array size, but also offsets via gimple_compare_field_offset.
> 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.
Yes, array types themselves can probably be kludged around, but the main issue
in Ada are record types with dynamic offsets, which are first-class citizens.