* dwarf2cfi.c (scan_trace): Handle annulled branch-taken delay slots.
authorRichard Henderson <rth@redhat.com>
Mon, 11 Jun 2012 18:04:25 +0000 (11:04 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 11 Jun 2012 18:04:25 +0000 (11:04 -0700)
From-SVN: r188391

gcc/ChangeLog
gcc/dwarf2cfi.c

index 76541d8141a91a75d1bb4759318241fe838ee1de..96cbe07f3bd8decf84001f4e8cbe39f244fd339b 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-11  Richard Henderson  <rth@redhat.com>
+
+       * dwarf2cfi.c (scan_trace): Handle annulled branch-taken delay slots.
+
 2012-06-11  Olivier Hainque  <hainque@adacore.com>
 
        * Makefile.in (GNATLIBCFLAGS_FOR_C): Remove $(PIC_FLAG_FOR_TARGET).
index bf2d802ffae26713f5966b7e01c0865b6b190e5a..3edb6e1250adc84dae3df00074a5700ea85af6e1 100644 (file)
@@ -2429,18 +2429,20 @@ scan_trace (dw_trace_info *trace)
 
              elt = XVECEXP (pat, 0, 1);
 
-             /* If ELT is an instruction from target of an annulled branch,
-                the effects are for the target only and so the args_size
-                and CFA along the current path shouldn't change.  */
              if (INSN_FROM_TARGET_P (elt))
                {
                  HOST_WIDE_INT restore_args_size;
                  cfi_vec save_row_reg_save;
 
+                 /* If ELT is an instruction from target of an annulled
+                    branch, the effects are for the target only and so
+                    the args_size and CFA along the current path
+                    shouldn't change.  */
                  add_cfi_insn = NULL;
                  restore_args_size = cur_trace->end_true_args_size;
                  cur_cfa = &cur_row->cfa;
-                 save_row_reg_save = VEC_copy (dw_cfi_ref, gc, cur_row->reg_save);
+                 save_row_reg_save
+                   = VEC_copy (dw_cfi_ref, gc, cur_row->reg_save);
 
                  scan_insn_after (elt);
 
@@ -2453,8 +2455,20 @@ scan_trace (dw_trace_info *trace)
                  cur_row->cfa = this_cfa;
                  cur_row->reg_save = save_row_reg_save;
                  cur_cfa = &this_cfa;
-                 continue;
                }
+             else
+               {
+                 /* If ELT is a annulled branch-taken instruction (i.e.
+                    executed only when branch is not taken), the args_size
+                    and CFA should not change through the jump.  */
+                 create_trace_edges (control);
+
+                 /* Update and continue with the trace.  */
+                 add_cfi_insn = insn;
+                 scan_insn_after (elt);
+                 def_cfa_1 (&this_cfa);
+               }
+             continue;
            }
 
          /* The insns in the delay slot should all be considered to happen