===================================================================
@@ -17340,6 +17340,14 @@ ix86_split_idivmod (enum machine_mode mo
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)
===================================================================
@@ -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 "";
})
===================================================================
@@ -143,6 +143,7 @@ extern void ix86_split_lshr (rtx *, rtx,
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);