diff options
author | Richard Henderson <rth@redhat.com> | 2011-11-26 16:10:18 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2011-11-26 16:10:18 -0800 |
commit | 2b894715ba76dc0e8ca8d73adc814d68deeacfda (patch) | |
tree | 01dacf29ef3b1b931a0f9ef419e373c31f31998d /gcc/optabs.c | |
parent | 022c0cd11d277b3e6b76c060f7f8d3f1dc675127 (diff) | |
download | gcc-2b894715ba76dc0e8ca8d73adc814d68deeacfda.zip gcc-2b894715ba76dc0e8ca8d73adc814d68deeacfda.tar.gz gcc-2b894715ba76dc0e8ca8d73adc814d68deeacfda.tar.bz2 |
Fix expand_atomic_fetch_op wrt unused_result.
* optabs.c (expand_atomic_fetch_op): Always return result.
From-SVN: r181750
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 0ce21e9..a1917cc 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -8068,7 +8068,7 @@ expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code, { /* If the result isn't used, no need to do compensation code. */ if (unused_result) - return target; + return result; /* Issue compensation code. Fetch_after == fetch_before OP val. Fetch_before == after REVERSE_OP val. */ @@ -8110,9 +8110,7 @@ expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code, result = emit_library_call_value (libfunc, NULL, LCT_NORMAL, mode, 2, addr, ptr_mode, val, mode); - if (unused_result) - return target; - if (fixup) + if (!unused_result && fixup) result = expand_simple_binop (mode, code, result, val, target, true, OPTAB_LIB_WIDEN); return result; |