This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] PR 15785
- From: Roger Sayle <roger at eyesopen dot com>
- To: "James A. Morrison" <ja2morri at csclub dot uwaterloo dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 13 Feb 2005 17:00:20 -0700 (MST)
- Subject: Re: [patch] PR 15785
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
--