This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping: [PATCH] PR 30315 Canonicalize overflow checks in simplify-rtx.c
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: rask at sygehus dot dk
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Sep 2007 02:55:06 +0200
- Subject: Re: Ping: [PATCH] PR 30315 Canonicalize overflow checks in simplify-rtx.c
> Date: Thu, 6 Sep 2007 12:40:46 +0200
> From: Rask Ingemann Lambertsen <rask@sygehus.dk>
> > Index: gcc/simplify-rtx.c
> > ===================================================================
> > --- gcc/simplify-rtx.c (revision 127838)
> > +++ gcc/simplify-rtx.c (working copy)
> > @@ -3722,6 +3722,12 @@ simplify_relational_operation_1 (enum rt
> > }
> > }
> >
> > + /* Canonicalize (LTU/GEU (PLUS a b) b) as (LTU/GEU (PLUS a b) a). */
> > + if ((code == LTU || code == GEU)
> > + && GET_CODE (op0) == PLUS
> > + && rtx_equal_p (op1, XEXP (op0, 1)))
> > + return simplify_gen_relational (code, mode, cmp_mode, op0, XEXP (op0, 0));
> > +
> > if (op1 == const0_rtx)
Uhm, you need to add "&& !rtx_equal_p (op1, XEXP (op0, 0))"
or you'll get an infinite recursions trying to simplify
(LTU (plus:SI (reg:SI 81) (reg:SI 81))
(reg:SI 81))
which happens for cris-elf, compiling
libstdc++-v3/testsuite/util/testsuite_abi.cc at the beginning of
the test-run.
(I'll commit as obvious after trunk fails on my x86_64 host or
if it passes regtest. I won't be sorry if someone beats me to
it.)
brgds, H-P
PS. Well, if it was obvious, wouldn't... :-)