+2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/68829
+ * doc/invoke.texi: Document change in behvaior for -Ofast for
+ Fortran.
+
2017-08-07 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_pushwb_single_reg):
@option{-O3} optimizations. It also enables optimizations that are not
valid for all standard-compliant programs.
It turns on @option{-ffast-math} and the Fortran-specific
-@option{-fno-protect-parens} and @option{-fstack-arrays}.
+@option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
+specified, and @option{-fno-protect-parens}.
@item -Og
@opindex Og
+2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/68829
+ PR fortran/81701
+ * options.c: Make -Ofast honor -fmax-stack-var-size.
+ * invoke.texi: Document change.
+
2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/79312
if (flag_protect_parens == -1)
flag_protect_parens = !optimize_fast;
- if (flag_stack_arrays == -1)
+ /* -Ofast sets implies -fstack-arrays unless an explicit size is set for
+ stack arrays. */
+ if (flag_stack_arrays == -1 && flag_max_stack_var_size == -2)
flag_stack_arrays = optimize_fast;
/* By default, disable (re)allocation during assignment for -std=f95,
flag_max_stack_var_size = -1;
}
+ /* Set flag_stack_arrays correctly. */
+ if (flag_stack_arrays == -1)
+ flag_stack_arrays = 0;
+
/* Set default. */
if (flag_max_stack_var_size == -2)
flag_max_stack_var_size = 32768;
+2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/68829
+ PR fortran/81701
+ * gfortran.dg/o_fast_stacksize.90: New test.
+
2017-08-07 Wilco Dijkstra <wdijkstr@arm.com>
PR middle-end/46932
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Ofast -fmax-stack-var-size=100 -fdump-tree-original" }
+MODULE foo
+CONTAINS
+ SUBROUTINE mysum(a)
+ INTEGER :: a(:)
+ WRITE(6,*) SUM(a)
+ END SUBROUTINE
+END MODULE foo
+
+USE foo
+INTEGER, ALLOCATABLE :: a(:)
+INTEGER, PARAMETER :: N=2**26 ! 256Mb array
+ALLOCATE(a(N)) ; a=1
+CALL mysum(a*a)
+END
+! { dg-final { scan-tree-dump-times "__builtin_malloc" 2 "original" } }