This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 May 2002 23:07:33 -0700
- Subject: Re: [PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0
- References: <Pine.LNX.4.33.0205041932550.31165-100000@www.eyesopen.com>
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~