------- Comment #20 from matz at gcc dot gnu dot org 2010-01-16 20:10 ------- It obviously could do the same. It all depends on the answer to this question: Do we want to deal with this via canonicalization of expressions, and if yes, then also on the outcome of our discussion of where that should happen (fold or special code in VN dealing with just value numbers). If no, then something like your patch can be done.
In this case I'm leaning towards Paolo (comment #14), we possibly might want to canonicalize towards fewer constants (hence towards positive constants), when otherwise the number of operations remains the same (hence treating PLUS_EXPR and MINUS_EXPR as equivalent). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19988