sync.md (atomic_compare_and_swap<dwi>_doubleword): If possible, add .cfi directives to record change to bx.

* config/i386/sync.md (atomic_compare_and_swap<dwi>_doubleword):
	If possible, add .cfi directives to record change to bx.
	* config/i386/i386.c (ix86_emit_cfi): New function.
	* config/i386/i386-protos.h (ix86_emit_cfi): Declare.

From-SVN: r204433
This commit is contained in:
Ian Lance Taylor 2013-11-06 01:03:57 +00:00 committed by Ian Lance Taylor
parent 39cf09b1f5
commit 674647e603
4 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2013-11-05 Ian Lance Taylor <iant@google.com>
* config/i386/sync.md (atomic_compare_and_swap<dwi>_doubleword):
If possible, add .cfi directives to record change to bx.
* config/i386/i386.c (ix86_emit_cfi): New function.
* config/i386/i386-protos.h (ix86_emit_cfi): Declare.
2013-11-05 Steven Bosscher <steven@gcc.gnu.org>

View File

@ -143,6 +143,7 @@ extern void ix86_split_lshr (rtx *, rtx, enum machine_mode);
extern rtx ix86_find_base_term (rtx);
extern bool ix86_check_movabs (rtx, int);
extern void ix86_split_idivmod (enum machine_mode, rtx[], bool);
extern bool ix86_emit_cfi ();
extern rtx assign_386_stack_local (enum machine_mode, enum ix86_stack_slot);
extern int ix86_attr_length_immediate_default (rtx, bool);

View File

@ -17344,6 +17344,14 @@ ix86_split_idivmod (enum machine_mode mode, rtx operands[],
emit_label (end_label);
}
/* Whether it is OK to emit CFI directives when emitting asm code. */
bool
ix86_emit_cfi ()
{
return dwarf2out_do_cfi_asm ();
}
#define LEA_MAX_STALL (3)
#define LEA_SEARCH_THRESHOLD (LEA_MAX_STALL << 1)

View File

@ -430,10 +430,21 @@
const char *xchg = "xchg{<imodesuffix>}\t%%<regprefix>bx, %5";
if (swap)
output_asm_insn (xchg, operands);
{
output_asm_insn (xchg, operands);
if (ix86_emit_cfi ())
{
output_asm_insn (".cfi_remember_state", operands);
output_asm_insn (".cfi_register\t%%<regprefix>bx, %5", operands);
}
}
output_asm_insn ("lock{%;} %K7cmpxchg<doublemodesuffix>b\t%2", operands);
if (swap)
output_asm_insn (xchg, operands);
{
output_asm_insn (xchg, operands);
if (ix86_emit_cfi ())
output_asm_insn (".cfi_restore_state", operands);
}
return "";
})