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] [4.2] Make fold, fold (type) (a CMP b) into a CMP b for integral types


On 8/29/05, Andrew Pinski <pinskia@physics.uc.edu> wrote:
> 
> On Aug 29, 2005, at 12:23 AM, Andrew Pinski wrote:
> > ChangeLog:
> >
> >       * fold-const.c (fold_unary) <case NOP_EXPR, CONVERT_EXPR>: For
> >       COMPARISON_CLASS_P and an integral types create create a new
> >       expression with the new type and fold that.
> 
> Oh, blast I attached the older version of this patch which did not
> compile
> because I had messed up the order of arguments for fold_build2.
> 
> Here is the correct one.

Is this really correct?  If yes, can you adjust tree.def which reads

/* Relational operators.
   `EQ_EXPR' and `NE_EXPR' are allowed for any types.
   The others are allowed only for integer (or pointer or enumeral)
   or real types.
   In all cases the operands will have the same type,
   and the value is always the type used by the language for booleans.  */
DEFTREECODE (LT_EXPR, "lt_expr", tcc_comparison, 2)
...

i.e. to ".. and the value is of any integer type.", which may not be
what we want.

Richard.


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