On 09/14/2016 01:21 PM, tbsaunde+...@tbsaunde.org wrote:
From: Trevor Saunders <tbsaunde+...@tbsaunde.org>

gcc/ChangeLog:

2016-09-13  Trevor Saunders  <tbsaunde+...@tbsaunde.org>

        * emit-rtl.c (prev_real_insn): Change argument type to rtx_insn *.
        * rtl.h: Adjust prototype.
        * config/sh/sh.md: Adjust.
        * dwarf2out.c (add_var_loc_to_decl): Likewise.
---
 gcc/config/sh/sh.md | 3 ++-
 gcc/dwarf2out.c     | 2 +-
 gcc/emit-rtl.c      | 4 +---
 gcc/rtl.h           | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index edc4d15..25e03ef 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -7178,7 +7178,8 @@
                      (label_ref (match_operand 1 "" ""))))
    (use (label_ref (match_operand 2 "" "")))]
   "TARGET_SH2
-   && (! INSN_UID (operands[1]) || prev_real_insn (operands[1]) == insn)"
+   && (! INSN_UID (operands[1])
+       || prev_real_insn (as_a<rtx_insn *> (operands[1])) == insn)"
OK, this is the "we passed an INSN in the operands field" fallout. Note how operand 1 is enclosed inside a (label_ref rtx)...

One way to deal with this would be to match the label_ref itself rather than the enclosed code_label. That'd require changing the casesi expander, but hopefully not much else.

But that can (IMHO), be a follow-up.

   "braf   %0%#"
   [(set_attr "needs_delay_slot" "yes")
    (set_attr "type" "jump_ind")])
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 45eb684..fb8ec7d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5408,7 +5408,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char 
*label)
       && NOTE_VAR_LOCATION_LOC (temp->first->loc)
       && GET_CODE (NOTE_VAR_LOCATION_LOC (temp->first->loc))
         == GET_CODE (DECL_INCOMING_RTL (decl))
-      && prev_real_insn (temp->first->loc) == NULL_RTX
+      && prev_real_insn (as_a<rtx_insn *> (temp->first->loc)) == NULL_RTX
Hmm... Hmmm. I would think ->loc should always be a NOTE_INSN_VAR_LOCATION here. Ahhh, and indeed look up a couple lines in the context, we only get here if NOTE_VAR_LOCATION_LOC (temp->first->loc) :-)


So this is OK once the prereqs have gone in.

jeff

Reply via email to