diff options
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index f89e053..562eb290 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2737,6 +2737,15 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, return temp; } + /* If there is no negation pattern, try subtracting from zero. */ + if (unoptab == neg_optab && class == MODE_INT) + { + temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0, + target, unsignedp, OPTAB_DIRECT); + if (temp) + return temp; + } + try_libcall: /* Now try a library call in this mode. */ if (unoptab->handlers[(int) mode].libfunc) |