On Tue, Nov 3, 2015 at 11:25 AM, Eric Botcazou <[email protected]> wrote:
>> I suggest to re-instantiate the canonical type checks for the aggregate type
>> case.
>
> OK, thanks, this fixes all the known ICEs so far.
>
> Tested on x86_64-suse-linux, OK for the mainline?
Please instead do the change here:
/* For aggregates compare only the size. Accesses to fields do have
a type information by themselves and thus we only care if we can i.e.
use the types in move operations. */
else if (AGGREGATE_TYPE_P (inner_type)
&& TREE_CODE (inner_type) == TREE_CODE (outer_type))
return (TYPE_MODE (outer_type) != BLKmode
|| operand_equal_p (TYPE_SIZE (inner_type),
TYPE_SIZE (outer_type), 0));
to
return TYPE_CANONICAL (inner_type)
&& TYPE_CANONICAL (outer_type) == TYPE_CANONICAL (inner_type)
Ok with that change.
Richard.
>
> 2015-11-03 Eric Botcazou <[email protected]>
>
> * gimple-expr.c (useless_type_conversion_p): Reinstate type canonical
> check for aggregate types and beef up comment for mode check.
>
>
> 2015-11-03 Eric Botcazou <[email protected]>
>
> * gnat.dg/discr45.adb: Only compile the test.
>
> --
> Eric Botcazou