patch for PR/23522
Ian Lance Taylor
ian@airs.com
Wed Sep 28 23:29:00 GMT 2005
Alexey Starovoytov <alexey.starovoytov@sun.com> writes:
> > What if we change the condition to
> > if (TREE_CODE (arg1_unw) != INTEGER_CST
> > || !int_fits_type_p (arg1_unw, shorter_type))
> > return NULL_TREE;
> >
> > Does that fix the problem?
>
> Yes.
> and going even further the 'if' should probably look like:
>
> if (TREE_CODE (arg1_unw) != INTEGER_CST
> || TREE_CODE (shorter_type) != INTEGER_TYPE
> || !int_fits_type_p (arg1_unw, shorter_type))
> return NULL_TREE;
>
> Certianly solves the problem and more safe.
I think you can reasonably use INTEGRAL_TYPE_P (shorter_type) instead
of TREE_CODE (shorter_type) != INTEGER_TYPE.
That patch is approved if it passes bootstrap and testing.
Thanks.
Ian
More information about the Gcc-patches
mailing list