aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@avtrex.com>2007-09-10 03:18:30 +0000
committerDavid Daney <daney@gcc.gnu.org>2007-09-10 03:18:30 +0000
commit3b010fe32e4a3dde31344cf518daf0b016da5401 (patch)
treef99928e5e8dcb82697af7b432a6894352b1c6546 /gcc/optabs.c
parent1d0bd356adb40de1b4fee26a663a691b9caa5853 (diff)
downloadgcc-3b010fe32e4a3dde31344cf518daf0b016da5401.zip
gcc-3b010fe32e4a3dde31344cf518daf0b016da5401.tar.gz
gcc-3b010fe32e4a3dde31344cf518daf0b016da5401.tar.bz2
optabs.c (expand_sync_operation): Use plus insn if minus CONST_INT_P(val).
* optabs.c (expand_sync_operation): Use plus insn if minus CONST_INT_P(val). (expand_sync_fetch_operation): Ditto. From-SVN: r128322
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index e8ac1d7..7f2b564 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -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];