Patchwork m68k: ignore -fstack-limit- if not supported

login
register
mail settings
Submitter Andreas Schwab
Date July 3, 2012, 9:48 a.m.
Message ID <m2y5n1ch0t.fsf@igel.home>
Download mbox | patch
Permalink /patch/168775/
State New
Headers show

Comments

Andreas Schwab - July 3, 2012, 9:48 a.m.
Since the prologue rewrite in RTL the invalid assembler output has
turned into an ICE.  Ignore the option on non-68020+.  Committed.

Andreas.

	PR target/28896
	* config/m68k/m68k.c (m68k_option_override): Reset stack_limit_rtx
	if !TARGET_68020.

testsuite/
	* gcc.target/m68k/stack-limit-1.c: New testcase.

Patch

diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 8684d0a..df70560 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -1,6 +1,6 @@ 
 /* Subroutines for insn-output.c for Motorola 68000 family.
    Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -618,6 +618,12 @@  m68k_option_override (void)
     }
 #endif
 
+  if (stack_limit_rtx != NULL_RTX && !TARGET_68020)
+    {
+      warning (0, "-fstack-limit- options are not supported on this cpu");
+      stack_limit_rtx = NULL_RTX;
+    }
+
   SUBTARGET_OVERRIDE_OPTIONS;
 
   /* Setup scheduling options.  */
diff --git a/gcc/testsuite/gcc.target/m68k/stack-limit-1.c b/gcc/testsuite/gcc.target/m68k/stack-limit-1.c
new file mode 100644
index 0000000..b1e9b99
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/stack-limit-1.c
@@ -0,0 +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 } */
+
+void dummy (void) { }