===================================================================
@@ -1938,8 +1938,6 @@ standard_type_bitsize (int bitsize)
static void
do_compile ()
{
- process_options ();
-
/* Don't do any more if an error has already occurred. */
if (!seen_error ())
{
@@ -2072,6 +2070,11 @@ toplev::main (int argc, char **argv)
save_decoded_options, save_decoded_options_count,
UNKNOWN_LOCATION, global_dc);
+ /* process_options() must execute before handle_common_deferred_options()
+ because handle_common_deferred_options() makes use of variables
+ initialized by process_options() (e.g. Pmode) */
+ process_options ();
+
handle_common_deferred_options ();
init_local_tick ();
===================================================================
@@ -0,0 +1,12 @@
+/* specifying stack-limit-register = r2 is only
+ meaningful on certain architectures */
+/* { target { powerpc*-*-* } } */
+/* { dg-do compile } */
+/* { dg-options "-fstack-limit-register=r2" } */
+void foo ()
+{
+ int N = 2;
+ int slots[N];
+
+}
+