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 15785


Roger Sayle <roger@eyesopen.com> writes:

> On 13 Feb 2005, James A. Morrison wrote:
> +      if (TREE_CODE (arg0) == BIT_NOT_EXPR)
> +	return fold (build2 (PLUS_EXPR, type, TREE_OPERAND (arg0, 0),
> +			     build_int_cst (NULL_TREE, 1)));
> 
> This integer constant needs to be of type "type", not NULL_TREE.
> And likewise for the other place you call build_int_cst.
> 
> You might also want to test for (A + -1) as a synonym of A - 1.
> I'm unsure if we canonicalize these to the same thing, and if so
> which form we prefer, but testing for both seems sensible.
> 
> Roger

 We don't seem to canonicalize this as the generic dump of x + (-1) is
x + -1.

-- 
Thanks,
Jim

http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim


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