2011-11-26 Richard Henderson <rth@redhat.com>
+ * optabs.c (expand_atomic_fetch_op): Always return result.
+
* optabs.c (init_sync_libfuncs_1): Include max in iteration.
* omp-low.c (expand_omp_atomic): Assume anything aligned to
{
/* 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. */
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;