]> gcc.gnu.org Git - gcc.git/commitdiff
expr.c (expand_assignment): Optimize away no-op moves where the source and destinatio...
authorRoger Sayle <roger@eyesopen.com>
Mon, 17 Apr 2006 16:49:54 +0000 (16:49 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 17 Apr 2006 16:49:54 +0000 (16:49 +0000)
* expr.c (expand_assignment): Optimize away no-op moves where the
source and destination are equal and have no side-effects.

From-SVN: r113009

gcc/ChangeLog
gcc/expr.c

index af150ff0005467c4301f0f9a8158ab64dd54b73f..6595ef506de721ab0c3362174cf9ed306173015b 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-17  Roger Sayle  <roger@eyesopen.com>
+
+       * expr.c (expand_assignment): Optimize away no-op moves where the
+       source and destination are equal and have no side-effects.
+
 2006-04-17  Richard Guenther  <rguenther@suse.de>
 
        PR target/26826
index b0e958c23b6fa351dfc84e7a5738b2165b32a8a8..f59cc426a175fb0b1b162f3657ad6c6805659384 100644 (file)
@@ -3988,13 +3988,16 @@ expand_assignment (tree to, tree from)
   rtx result;
 
   /* Don't crash if the lhs of the assignment was erroneous.  */
-
   if (TREE_CODE (to) == ERROR_MARK)
     {
       result = expand_normal (from);
       return;
     }
 
+  /* Optimize away no-op moves without side-effects.  */
+  if (operand_equal_p (to, from, 0))
+    return;
+
   /* Assignment of a structure component needs special treatment
      if the structure component's rtx is not simply a MEM.
      Assignment of an array element at a constant index, and assignment of
This page took 0.080241 seconds and 5 git commands to generate.