rs6000.c (rs6000_pre_atomic_barrier): Pass in and return mem.

* config/rs6000/rs6000.c (rs6000_pre_atomic_barrier): Pass in and
	return mem.  Convert to indirect addressing if not indirect or
	indexed.  Adjust all callers.

From-SVN: r188884
This commit is contained in:
Alan Modra 2012-06-22 21:44:12 +09:30 committed by Alan Modra
parent de703cd7d4
commit d25df88254
2 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2012-06-22 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_pre_atomic_barrier): Pass in and
return mem. Convert to indirect addressing if not indirect or
indexed. Adjust all callers.
2012-06-22 Richard Guenther <rguenther@suse.de>
* gcov-iov.c: Include bconfig.h and system.h.

View File

@ -16527,9 +16527,19 @@ emit_store_conditional (enum machine_mode mode, rtx res, rtx mem, rtx val)
/* Expand barriers before and after a load_locked/store_cond sequence. */
static void
rs6000_pre_atomic_barrier (enum memmodel model)
static rtx
rs6000_pre_atomic_barrier (rtx mem, enum memmodel model)
{
rtx addr = XEXP (mem, 0);
int strict_p = (reload_in_progress || reload_completed);
if (!legitimate_indirect_address_p (addr, strict_p)
&& !legitimate_indexed_address_p (addr, strict_p))
{
addr = force_reg (Pmode, addr);
mem = replace_equiv_address_nv (mem, addr);
}
switch (model)
{
case MEMMODEL_RELAXED:
@ -16546,6 +16556,7 @@ rs6000_pre_atomic_barrier (enum memmodel model)
default:
gcc_unreachable ();
}
return mem;
}
static void
@ -16684,7 +16695,7 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
else if (reg_overlap_mentioned_p (retval, oldval))
oldval = copy_to_reg (oldval);
rs6000_pre_atomic_barrier (mod_s);
mem = rs6000_pre_atomic_barrier (mem, mod_s);
label1 = NULL_RTX;
if (!is_weak)
@ -16769,7 +16780,7 @@ rs6000_expand_atomic_exchange (rtx operands[])
mode = SImode;
}
rs6000_pre_atomic_barrier (model);
mem = rs6000_pre_atomic_barrier (mem, model);
label = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ());
emit_label (XEXP (label, 0));
@ -16853,7 +16864,7 @@ rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
mode = SImode;
}
rs6000_pre_atomic_barrier (model);
mem = rs6000_pre_atomic_barrier (mem, model);
label = gen_label_rtx ();
emit_label (label);