]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use ADD if result isn't used in memory address.
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 14 Sep 2010 18:12:04 +0000 (18:12 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 14 Sep 2010 18:12:04 +0000 (11:12 -0700)
2010-09-14  H.J. Lu  <hongjiu.lu@intel.com>

* config/i386/i386.c (ix86_lea_for_add_ok): Return false if
result isn't used in memory address.

From-SVN: r164287

gcc/ChangeLog
gcc/config/i386/i386.c

index aeab6887b3b908d339d38a4115d2807d77ab9ff1..979489b0abcbf82923fca85d6e81f56b2e5be554 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/i386/i386.c (ix86_lea_for_add_ok): Return false if
+       result isn't used in memory address.
+
 2010-09-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * defaults.h (UNITS_PER_SIMD_WORD): Removed.
index 1d4e4aed715794fd90eafe4e98a4f49a8605216f..19d6387d4440fd3381258e343128ba7a256de2bf 100644 (file)
@@ -14871,15 +14871,19 @@ ix86_lea_for_add_ok (rtx insn, rtx operands[])
   else
     {
       int dist_define, dist_use;
+
+      /* Return false if REGNO0 isn't used in memory address. */
+      dist_use = distance_agu_use (regno0, insn);
+      if (dist_use <= 0)
+       return false;
+
       dist_define = distance_non_agu_define (regno1, regno2, insn);
       if (dist_define <= 0)
         return true;
 
       /* If this insn has both backward non-agu dependence and forward
          agu dependence, the one with short distance take effect. */
-      dist_use = distance_agu_use (regno0, insn);
-      if (dist_use <= 0
-         || (dist_define + IX86_LEA_PRIORITY) < dist_use)
+      if ((dist_define + IX86_LEA_PRIORITY) < dist_use)
         return false;
 
       return true;