This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]