This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Fix PR33724, fix PR19382 differently
> Which would be the following; testing in progress.
Thanks, this would be nicer to Ada. :-)
Btw, any particular reason why the new check uses TYPE_POINTER_TO? This field
is a little awkward to deal with. Can't we keep using the old idiom from
check_pointer_types_r, i.e. testing the pointed-to type instead?
ptype = TREE_TYPE (t);
otype = TREE_TYPE (TREE_OPERAND (t, 0));
dtype = TREE_TYPE (ptype);
if (!cpt_same_type (otype, dtype))
/* &array is allowed to produce a pointer to the element, rather than
a pointer to the array type. We must allow this in order to
properly represent assigning the address of an array in C into
pointer to the element type. */
gcc_assert (TREE_CODE (otype) == ARRAY_TYPE
&& POINTER_TYPE_P (ptype)
&& cpt_same_type (TREE_TYPE (otype), dtype));