This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not use TYPE_CANONICAL in useless_type_conversion
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Bernd Schmidt <bschmidt at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, law at redhat dot com
- Date: Thu, 8 Oct 2015 05:49:34 +0200
- Subject: Re: Do not use TYPE_CANONICAL in useless_type_conversion
- Authentication-results: sourceware.org; auth=none
- References: <20151002180022 dot GA32564 at kam dot mff dot cuni dot cz> <11111201 dot hIrLzgQcuo at polaris> <20151002214127 dot GC84720 at kam dot mff dot cuni dot cz> <20151002215225 dot GA14667 at kam dot mff dot cuni dot cz> <56126C73 dot 4070205 at redhat dot com> <20151005153458 dot GB9972 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1510061304480 dot 6516 at zhemvz dot fhfr dot qr> <20151006175437 dot GC43326 at kam dot mff dot cuni dot cz> <20151007060040 dot GA65469 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1510071050390 dot 6516 at zhemvz dot fhfr dot qr>
>
> && TREE_CODE (outer_type) == OFFSET_TYPE
>
> Ok with those changes.
Thank you! I commited the patch.
At a hike today it appeared to me that for ipa-icf and other calling convetions
checks we should not rely on useless_type_conversion_p because there may be
types that are compatible in gimple type system but have different calling
conventions. I will hack calling convention comparer tomorrow - should not be
too hard, just doing the cumulative walk and comparing that the RTL containers
are the same.
Honza
>
> Thanks,
> Richard.
>
> > + return useless_type_conversion_p (TREE_TYPE (outer_type),
> > + TREE_TYPE (inner_type))
> > + && useless_type_conversion_p
> > + (TYPE_OFFSET_BASETYPE (outer_type),
> > + TYPE_OFFSET_BASETYPE (inner_type));
> >
> > return false;
> > }