From: Ian Lance Taylor Date: Wed, 6 Nov 2013 01:03:57 +0000 (+0000) Subject: sync.md (atomic_compare_and_swap_doubleword): If possible, add .cfi directives... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=674647e60381fe980fda563eea96e0536150057d;hp=39cf09b1f55b630ee462edce769bf8e9562ef74a;p=gcc.git sync.md (atomic_compare_and_swap_doubleword): If possible, add .cfi directives to record change to bx. * config/i386/sync.md (atomic_compare_and_swap_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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2727156ca8d..d5c8ceb1c5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-11-05 Ian Lance Taylor + + * config/i386/sync.md (atomic_compare_and_swap_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 diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 5799251404b..fdf9d5804df 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -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); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 771fabe6dc5..3d3838b97f9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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) diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md index 9e5835662e1..8408a2bfe43 100644 --- a/gcc/config/i386/sync.md +++ b/gcc/config/i386/sync.md @@ -430,10 +430,21 @@ const char *xchg = "xchg{}\t%%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%%bx, %5", operands); + } + } output_asm_insn ("lock{%;} %K7cmpxchgb\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 ""; })