2016-02-16 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR Target/48344
* opts-global.c (handle_common_deferred_options): Introduce and
initialize two global variables to remember command-line options
specifying a stack-limiting register.
* opts.h: Add extern declarations of the two new global variables.
* emit-rtl.c (init_emit_once): Initialize the stack_limit_rtx
variable based on the values of the two new global variables.
[gcc/testsuite]
2016-02-16 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR Target/48344
* gcc.target/powerpc/pr48344-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233477
138bc75d-0d04-0410-961f-
82ee72b054a4
+2016-02-16 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ PR Target/48344
+ * opts-global.c (handle_common_deferred_options): Introduce and
+ initialize two global variables to remember command-line options
+ specifying a stack-limiting register.
+ * opts.h: Add extern declarations of the two new global variables.
+ * emit-rtl.c (init_emit_once): Initialize the stack_limit_rtx
+ variable based on the values of the two new global variables.
+
2016-02-16 Jakub Jelinek <jakub@redhat.com>
PR c/69835
#include "builtins.h"
#include "rtl-iter.h"
#include "stor-layout.h"
+#include "opts.h"
struct target_rtl default_target_rtl;
#if SWITCHABLE_TARGET
/* Create the unique rtx's for certain rtx codes and operand values. */
+ /* Process stack-limiting command-line options. */
+ if (opt_fstack_limit_symbol_arg != NULL)
+ stack_limit_rtx
+ = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt_fstack_limit_symbol_arg));
+ if (opt_fstack_limit_register_no >= 0)
+ stack_limit_rtx = gen_rtx_REG (Pmode, opt_fstack_limit_register_no);
+
/* Don't use gen_rtx_CONST_INT here since gen_rtx_CONST_INT in this case
tries to use these variables. */
for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++)
finish_options (opts, opts_set, loc);
}
+/* Hold command-line options associated with stack limitation. */
+const char *opt_fstack_limit_symbol_arg = NULL;
+int opt_fstack_limit_register_no = -1;
+
/* Process common options that have been deferred until after the
handlers have been called for all options. */
if (reg < 0)
error ("unrecognized register name %qs", opt->arg);
else
- stack_limit_rtx = gen_rtx_REG (Pmode, reg);
+ {
+ /* Deactivate previous OPT_fstack_limit_symbol_ options. */
+ opt_fstack_limit_symbol_arg = NULL;
+ opt_fstack_limit_register_no = reg;
+ }
}
break;
case OPT_fstack_limit_symbol_:
- stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg));
+ /* Deactivate previous OPT_fstack_limit_register_ options. */
+ opt_fstack_limit_register_no = -1;
+ opt_fstack_limit_symbol_arg = opt->arg;
break;
case OPT_fasan_shadow_offset_:
struct cl_option_handler_func handlers[3];
};
+/* Hold command-line options associated with stack limitation. */
+extern const char *opt_fstack_limit_symbol_arg;
+extern int opt_fstack_limit_register_no;
+
/* Input file names. */
extern const char **in_fnames;
+2016-02-16 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ PR Target/48344
+ * gcc.target/powerpc/pr48344-1.c: New test.
+
2015-02-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/69742
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fstack-limit-register=r2" } */
+void foo ()
+{
+ int N = 2;
+ int slots[N];
+
+}