This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: tree-ssa bug?
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Eyal Lebedinsky <eyal at eyal dot emu dot id dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 3 Apr 2003 09:18:46 -0500
- Subject: Re: tree-ssa bug?
- Organization: Red Hat Canada
- References: <3E8C28D6.7DD9AC72@eyal.emu.id.au>
On Thu, 03 Apr 2003, Eyal Lebedinsky wrote:
> Built off CVS branch tree-ssa-20020619-branch.
> Linux 2.4, i386
>
> OK, here is another very strange result, took me a bit of time to track
> this one down.
>
Good catch. This was an omission in the new non destructive
folders. When folding comparisons with signed_max+1 we were
always replacing the comparison with >=.
Diego.
* fold-const.c (fold_relational_hi_lo): Add missing comparison when
folding comparisons to signed_max+1.
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.25
diff -d -u -p -r1.213.2.25 fold-const.c
--- fold-const.c 27 Feb 2003 18:30:02 -0000 1.213.2.25
+++ fold-const.c 3 Apr 2003 14:14:41 -0000
@@ -4983,7 +4983,7 @@ fold_relational_hi_lo (code_p, type_p, o
st0 = (*lang_hooks.types.signed_type) (TREE_TYPE (op0));
st1 = (*lang_hooks.types.signed_type) (TREE_TYPE (op1));
- exp = build (LE_EXPR ? GE_EXPR: LT_EXPR,
+ exp = build (code == LE_EXPR ? GE_EXPR: LT_EXPR,
type,
convert (st0, op0),
convert (st1, integer_zero_node));