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] Fix PR78546


Hi Richard,


I am just wondering if this might be a mistake,
because this looks somehow odd:

 > +  /* CST - (CST - A) -> CST - A  */
 > +  (simplify
 > +   (minus CONSTANT_CLASS_P@1 (minus CONSTANT_CLASS_P@2 @0))
 > +   (with { tree cst = const_binop (MINUS_EXPR, type, @1, @2); }
 > +    (if (cst && !TREE_OVERFLOW (cst))
 > +     (minus { cst; } @0))))


isn't CST1 - (CST2 - A) == (CST1 - CST2) + A
thus (plus { cst; } @0) ??


Bernd.

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