[Bug tree-optimization/53774] Reassociator generates non-canonical addition

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 26 08:56:00 GMT 2012


Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-06-26
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 08:56:35 UTC ---
Confirmed with -O1.  get_rank (fp_6(D)) returns the same value as
get_rank (constant).  Constants should always have a lesser rank than

Index: gcc/tree-ssa-reassoc.c
--- gcc/tree-ssa-reassoc.c      (revision 188927)
+++ gcc/tree-ssa-reassoc.c      (working copy)
@@ -337,7 +337,7 @@ get_rank (tree e)
   /* Constants have rank 0.  */
   if (is_gimple_min_invariant (e))
-    return 0;
+    return -1;

   /* SSA_NAME's have the rank of the expression they are the result

would fix it, but I'm not sure we want negative ranks.

More information about the Gcc-bugs mailing list