https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65249

--- Comment #10 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
On second thought, we could fix this with an adhoc way.
I'm testing the following patch for 4.9.

diff --git a/config/sh/sh.md b/config/sh/sh.md
index d957e55..93fd84e 100644
--- a/config/sh/sh.md
+++ b/config/sh/sh.md
@@ -10274,7 +10202,10 @@ label:
       && GET_CODE (XVECEXP (XEXP (operands[1], 0), 0, 0)) == SYMBOL_REF
       && strcmp (XSTR (XVECEXP (XEXP (operands[1], 0), 0, 0), 0),
          "__stack_chk_guard") == 0)
-    emit_insn (gen_chk_guard_add (operands[3], operands[2]));
+    {
+      emit_barrier ();
+      emit_insn (gen_chk_guard_add (operands[3], operands[2]));
+    }
   else
     emit_move_insn (operands[3], gen_rtx_PLUS (Pmode, operands[2],
                            gen_rtx_REG (Pmode, PIC_REG)));

Reply via email to