optabs.c (expand_sync_operation): Use plus insn if minus CONST_INT_P(val).
authorDavid Daney <ddaney@avtrex.com>
Mon, 10 Sep 2007 03:18:30 +0000 (03:18 +0000)
committerDavid Daney <daney@gcc.gnu.org>
Mon, 10 Sep 2007 03:18:30 +0000 (03:18 +0000)
* optabs.c (expand_sync_operation):  Use plus insn if minus
CONST_INT_P(val).
(expand_sync_fetch_operation):  Ditto.

From-SVN: r128322

gcc/ChangeLog
gcc/optabs.c

index 8962b81ddaa10d52d35ed4d9b9599d39939963b5..0a493c19e41fca19507b1a0325da684a69909538 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-09  David Daney  <ddaney@avtrex.com>
+
+       * optabs.c (expand_sync_operation):  Use plus insn if minus
+       CONST_INT_P(val).
+       (expand_sync_fetch_operation):  Ditto.
+
 2007-09-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * i386.md (*floatsisf2_mixed_vector): Use cvtdq2ps instead
index e8ac1d707d4697bd4232f11e8a89abd4fb9d99e4..7f2b5642ad7d5bd78099d01575d71540d7ec697c 100644 (file)
@@ -7242,7 +7242,7 @@ expand_sync_operation (rtx mem, rtx val, enum rtx_code code)
 
     case MINUS:
       icode = sync_sub_optab[mode];
-      if (icode == CODE_FOR_nothing)
+      if (icode == CODE_FOR_nothing || CONST_INT_P (val))
        {
          icode = sync_add_optab[mode];
          if (icode != CODE_FOR_nothing)
@@ -7342,7 +7342,8 @@ expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code,
     case MINUS:
       old_code = sync_old_sub_optab[mode];
       new_code = sync_new_sub_optab[mode];
-      if (old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing)
+      if ((old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing)
+          || CONST_INT_P (val))
        {
          old_code = sync_old_add_optab[mode];
          new_code = sync_new_add_optab[mode];