Michael Matz wrote:
Try this patch. I've verified that capacita and nf work with it and
-march=native -ffast-math -funroll-loops -fstack-arrays -O3 . In fact all
of polyhedron works for me on these flags. (I've set a ulimit -s of
512MB, but I don't know if such a large amount is required).
The patch is OK.
* As mentioned a couple of times, you need a "tmp = NULL_TREE" in
gfc_trans_auto_array_allocation - either when "tmp" is declared or in
the "if (...flag_stack_arrays)" block.
* Can you also update http://gcc.gnu.org/wiki/GFortran#GCC4.7 and/or
http://gcc.gnu.org/gcc-4.7/changes.html#fortran ?
Thanks a lot for your patch(es). As Dominique has remarked, the results
are "Pretty spectacular". (Twice as fast for fatigue and the geometric
mean of the Polyhedron test improves by 6%.)
* * *
Side remark: For 4.7 I now hope that inlining gets better tuned for
Fortran as the is room for improvement; quoting your numbers for fatigue:
no stack-arrays with stack-arrays
+ -fwhole-program -flto: 10.1s 8.9s
+ -fwhole-program -flto -finline-limit=600 4.8s 3.6s
Thus, the program is twice as fast with the special inline setting. But
as users will typically never set more than "-O3 -march=native
-ffast-math" (and maybe: -funroll-loops), the inline opportunity is lost
in real life.
Tobias
* trans-array.c (toplevel): Include gimple.h.
(gfc_trans_allocate_array_storage): Check flag_stack_arrays,
properly expand variable length arrays.
(gfc_trans_auto_array_allocation): If flag_stack_arrays create
variable length decls and associate them with their scope.
* gfortran.h (gfc_option_t): Add flag_stack_arrays member.
* options.c (gfc_init_options): Handle -fstack_arrays option.
* lang.opt (fstack-arrays): Add option.
* invoke.texi (Code Gen Options): Document it.
* Make-lang.in (trans-array.o): Depend on GIMPLE_H.