Call reload_cse_simplify_set before reload_cse_noop_set_p
authorAldy Hernandez <aldyh@redhat.com>
Mon, 12 Mar 2001 04:30:56 +0000 (04:30 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Mon, 12 Mar 2001 04:30:56 +0000 (04:30 +0000)
From-SVN: r40394

gcc/ChangeLog
gcc/reload1.c

index a0b21d9a4b50dc9b0704fc24fdce5d6b9828e9be..7b1751dc89265b6f10e9c35c26dae090edce02d3 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-12  Aldy Hernandez  <aldyh@redhat.com>
+
+        * reload1.c (reload_cse_simplify): Call reload_cse_simplify_set
+        before reload_cse_noop_set_p.
+
 2001-03-11  Zack Weinberg  <zackw@stanford.edu>
 
        * config.gcc: Where xm-host.h used to include another
index 077c410d82586d7d3603d5bfb1a22e48b2d3e479..2f64c2d7d4a044c70c897e826af071e09ec93e8f 100644 (file)
@@ -8041,7 +8041,15 @@ reload_cse_simplify (insn)
   if (GET_CODE (body) == SET)
     {
       int count = 0;
-      if (reload_cse_noop_set_p (body))
+
+      /* Simplify even if we may think it is a no-op.
+         We may think a memory load of a value smaller than WORD_SIZE
+         is redundant because we haven't taken into account possible
+         implicit extension.  reload_cse_simplify_set() will bring
+         this out, so it's safer to simplify before we delete.  */
+      count += reload_cse_simplify_set (body, insn);
+
+      if (!count && reload_cse_noop_set_p (body))
        {
          rtx value = SET_DEST (body);
          if (! REG_FUNCTION_VALUE_P (SET_DEST (body)))
@@ -8050,9 +8058,6 @@ reload_cse_simplify (insn)
          return;
        }
 
-      /* It's not a no-op, but we can try to simplify it.  */
-      count += reload_cse_simplify_set (body, insn);
-
       if (count > 0)
        apply_change_group ();
       else