On Jul 15, 2006, at 1:12 PM, Mark Mitchell wrote:
OK. But, GIMPLE is also supposed to be type-safe, so I wouldn't think
that "int = long" would be well-formed gimple.
Right now it is for 32bit targets because of
tree_ssa_useless_type_conversion_1's:
/* If both the inner and outer types are integral types, then the
conversion is not necessary if they have the same mode and
signedness and precision, and both or neither are boolean. Some
code assumes an invariant that boolean types stay boolean and do
not become 1-bit bit-field types. Note that types with precision
not using all bits of the mode (such as bit-field types in C)
mean that testing of precision is necessary. */
else if (INTEGRAL_TYPE_P (inner_type)
&& INTEGRAL_TYPE_P (outer_type)
&& TYPE_UNSIGNED (inner_type) == TYPE_UNSIGNED (outer_type)
&& TYPE_PRECISION (inner_type) == TYPE_PRECISION
(outer_type)
&& simple_cst_equal (TYPE_MAX_VALUE (inner_type),
TYPE_MAX_VALUE (outer_type))
&& simple_cst_equal (TYPE_MIN_VALUE (inner_type),
TYPE_MIN_VALUE (outer_type)))
Even right now we allow "int* = void*" without a cast. I posted a patch
to fix that up at <http://gcc.gnu.org/ml/gcc-patches/2006-06/
msg00179.html>
which I am still waiting for approval for.
Thanks,
Andrew Pinski