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 v4] PR target/30315 i386 missed optimization detecting overflows


On Thu, Aug 30, 2007 at 12:47:22PM +0200, Rask Ingemann Lambertsen wrote:
> On Wed, Aug 29, 2007 at 07:30:37PM +0200, Rask Ingemann Lambertsen wrote:
> > 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));
> > +
> 
>    I've changed my mind on this, we want (ltu (plus a b) b) instead. Why? A
> can be complex expression.

   And I've changed my mind back, since the original canonicalization allows
macroization of insn patterns because PLUS and MINUS then have the
comparison operands in the same order: (compare (plus/minus a b) a).

-- 
Rask Ingemann Lambertsen


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