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: add new transformations in cse



On Tuesday, December 18, 2001, at 05:36 , Dale Johannesen wrote:

> +     case PLUS:
> +       /* If we have (PLUS X Y), see if X is known to be (NEG Z).
> +        If so, this simplifies to (MINUS Y Z).  */
> +

Forgive me if this code only deals with unsigned types and my comment is
way off, but for signed types I don't think this holds. If Z==-32768,
then NEG Z would be zero and the operation yields (PLUS 0 Y), but with 
the
simplification it would ield (MINUS Y -32768). Maybe an extra comment 
about
the kind of values this handles would be nice, since I can't easily 
derive
this from the context in cse.c.

   -Geert


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