+2011-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/48864
+ * doc/invoke.texi (Ofast): Document that it
+ enables Fortran's -fno-protect-parens.
+
2011-05-04 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_reorg): Run move_or_delete_vzeroupper first.
Disregard strict standards compliance. @option{-Ofast} enables all
@option{-O3} optimizations. It also enables optimizations that are not
valid for all standard compliant programs.
-It turns on @option{-ffast-math}.
+It turns on @option{-ffast-math} and the Fortran-specific
+@option{-fno-protect-parens}.
If you use multiple @option{-O} options, with or without level numbers,
the last such option is the one that is effective.
+2011-05-04 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/48864
+ * invoke.texi (fno-protect-parens): Document
+ that -Ofast implies -fno-protect-parens.
+ * options.c (gfc_init_options, gfc_post_options):
+ Make -Ofast imply -fno-protect-parens.
+
2011-05-04 Nathan Froyd <froydnj@codesourcery.com>
* trans-decl.c (build_library_function_decl_1): Call
@option{-fno-protect-parens} allows the compiler to reorder @code{REAL} and
@code{COMPLEX} expressions to produce faster code. Note that for the re-association
optimization @option{-fno-signed-zeros} and @option{-fno-trapping-math}
-need to be in effect.
+need to be in effect. The parentheses protection is enabled by default, unless
+@option{-Ofast} is given.
@item -frealloc-lhs
@opindex @code{frealloc-lhs}
gfc_option.flag_init_character = GFC_INIT_CHARACTER_OFF;
gfc_option.flag_init_character_value = (char)0;
gfc_option.flag_align_commons = 1;
- gfc_option.flag_protect_parens = 1;
+ gfc_option.flag_protect_parens = -1;
gfc_option.flag_realloc_lhs = -1;
gfc_option.flag_aggressive_function_elimination = 0;
gfc_option.flag_frontend_optimize = -1;
if (flag_associative_math == -1)
flag_associative_math = (!flag_trapping_math && !flag_signed_zeros);
+ if (gfc_option.flag_protect_parens == -1)
+ gfc_option.flag_protect_parens = !optimize_fast;
+
/* By default, disable (re)allocation during assignment for -std=f95,
and enable it for F2003/F2008/GNU/Legacy. */
if (gfc_option.flag_realloc_lhs == -1)