This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Re-structure tree_ssa_useless_type_conversion_1 to work towards a middle-end type system
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Wed, 20 Jun 2007 17:04:34 +0200
- Subject: Re: [PATCH][RFC] Re-structure tree_ssa_useless_type_conversion_1 to work towards a middle-end type system
- References: <Pine.LNX.4.64.0706201354510.24708@zhemvz.fhfr.qr>
> /* Return true if the conversion from INNER_TYPE to OUTER_TYPE is a
> ! useless type conversion, otherwise return false.
> ! This function implicitly defines the middle-end type system. The
> ! following invariants shall be fulfilled:
> !
> ! 1) tree_ssa_useless_type_conversion_1 is transitive. If
> ! a < b and b < c then a < c.
> !
> ! 2) tree_ssa_useless_type_conversion_1 is not communtative.
> ! From a < b does not follow a > b.
> !
> ! 3) Conversions are useless only if with the resulting type
> ! can be used in a subset of the operations the original type
> ! can be applied to. For example casts to void* are useless,
> ! casts from void* not. Casts to const T* are useless, casts
> ! from const T* to T* not.
My understanding is that it's a relation, not an operation, so the proper term
for 2 would be "symmetric". For the sake of completeness, you could also add
that it's reflexive: a < a holds.
Which would suggest to find a better symbol than '<' for it. :-)
--
Eric Botcazou