diff mbox

[v4] PR48344: Fix unrecognizable insn error with -fstack-limit-register=r2

Message ID 87wphcaths.fsf@linux-m68k.org
State New
Headers show

Commit Message

Andreas Schwab Oct. 13, 2016, 8:23 p.m. UTC
I've committed this to fix the ICE.

Andreas.

	* config/m68k/m68k.c (m68k_option_override): Check
	opt_fstack_limit_symbol_arg and opt_fstack_limit_register_no
	instead of stack_limit_rtx.

	* gcc.target/m68k/stack-limit-1.c: Expect warning on line 0.
diff mbox

Patch

diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index e6bcfa0caf..a883e42514 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -638,10 +638,12 @@  m68k_option_override (void)
     }
 #endif
 
-  if (stack_limit_rtx != NULL_RTX && !TARGET_68020)
+  if ((opt_fstack_limit_symbol_arg != NULL || opt_fstack_limit_register_no >= 0)
+      && !TARGET_68020)
     {
       warning (0, "-fstack-limit- options are not supported on this cpu");
-      stack_limit_rtx = NULL_RTX;
+      opt_fstack_limit_symbol_arg = NULL;
+      opt_fstack_limit_register_no = -1;
     }
 
   SUBTARGET_OVERRIDE_OPTIONS;
diff --git a/gcc/testsuite/gcc.target/m68k/stack-limit-1.c b/gcc/testsuite/gcc.target/m68k/stack-limit-1.c
index b1e9b99b26..5086edd77f 100644
--- a/gcc/testsuite/gcc.target/m68k/stack-limit-1.c
+++ b/gcc/testsuite/gcc.target/m68k/stack-limit-1.c
@@ -1,6 +1,6 @@ 
 /* -fstack-limit- should be ignored without an ICE if not supported.  */
 /* { dg-do compile } */
 /* { dg-options "-fstack-limit-symbol=_stack_limit -m68000" } */
-/* { dg-warning "not supported" "" { target *-*-* } 1 } */
+/* { dg-warning "not supported" "" { target *-*-* } 0 } */
 
 void dummy (void) { }