re PR target/83760 ([SH] ICE in maybe_record_trace_start building glibc tst-copy_file...
authorJeff Law <law@redhat.com>
Tue, 13 Feb 2018 03:07:04 +0000 (20:07 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 13 Feb 2018 03:07:04 +0000 (20:07 -0700)
PR target/83760
* config/sh/sh.c (find_barrier): Consider a sibling call
a barrier as well.

From-SVN: r257611

gcc/ChangeLog
gcc/config/sh/sh.c

index d5913d0a7db58324d714fc24f7f8e7485283f4f4..a74c8610443bd802525f972114e6d79029f34458 100644 (file)
@@ -1,5 +1,9 @@
 2018-02-12  Jeff Law  <law@redhat.com>
 
+       PR target/83760
+       * config/sh/sh.c (find_barrier): Consider a sibling call
+       a barrier as well.
+
        * cse.c (try_back_substitute_reg): Move any REG_ARGS_SIZE note when
        successfully back substituting a reg.
 
index 48e99a3cadf1d5cf2dbc47f2bd633fbd3d5b6af8..90d6c733d335279d390ddefc2fa34d0db8e493ae 100644 (file)
@@ -5233,10 +5233,22 @@ find_barrier (int num_mova, rtx_insn *mova, rtx_insn *from)
         CALL_ARG_LOCATION note.  */
       if (CALL_P (from))
        {
+         bool sibcall_p = SIBLING_CALL_P (from);
+
          rtx_insn *next = NEXT_INSN (from);
          if (next && NOTE_P (next)
              && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
            from = next;
+
+         /* If FROM was a sibling call, then we know that control
+            will not return.  In fact, we were guaranteed to hit
+            a barrier before another real insn.
+
+            The jump around the constant pool is unnecessary.  It
+            costs space, but more importantly it confuses dwarf2cfi
+            generation.  */
+         if (sibcall_p)
+           return emit_barrier_after (from);
        }
 
       from = emit_jump_insn_after (gen_jump (label), from);