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: Ping: [PATCH] PR 30315 Canonicalize overflow checks in simplify-rtx.c


On Mon, Sep 10, 2007 at 02:55:06AM +0200, Hans-Peter Nilsson wrote:
> > 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))

   Looks right to me. I'll test that and commit if it passes.
 
> which happens for cris-elf, compiling
> libstdc++-v3/testsuite/util/testsuite_abi.cc at the beginning of
> the test-run.

   I usually test on cris-axis-elf also, but I got a build failure in
libstdc++. I think that might have been a problem at my end, though.

-- 
Rask Ingemann Lambertsen


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