[PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0

Richard Henderson rth@redhat.com
Sat May 4 23:07:00 GMT 2002


On Sat, May 04, 2002 at 07:59:52PM -0600, Roger Sayle wrote:
> +   /* Tree EXP must have a signed integral type.  */
> +   t = TREE_TYPE (exp);
> +   if (! INTEGRAL_TYPE_P (t) || TREE_UNSIGNED (t))
> +     return 0;

I think you should also handle unsigned types.  You should
render "uint & c" as "(signed int)uint < 0".

> +       hi = (unsigned HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT);

 width - HOST_BITS_PER_WIDE_INT - 1


r~



More information about the Gcc-patches mailing list