PATCH: add new transformations in cse

Geert Bosch bosch@gnat.com
Tue Dec 18 17:02:00 GMT 2001


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



More information about the Gcc-patches mailing list