aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-05-04 19:10:15 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-05-04 19:10:15 +0200
commit7a99464652b2b96dfc1bc02cbd4e7c960dc0fb7b (patch)
tree7e2d93b774a2c1310cd92921181be84f96a5f78c /gcc/fortran
parente19a18d4e42fcf080cc7c3db2d38d11feade5347 (diff)
downloadgcc-7a99464652b2b96dfc1bc02cbd4e7c960dc0fb7b.zip
gcc-7a99464652b2b96dfc1bc02cbd4e7c960dc0fb7b.tar.gz
gcc-7a99464652b2b96dfc1bc02cbd4e7c960dc0fb7b.tar.bz2
re PR fortran/48864 (-Ofast should imply -fno-protect-parens)
gcc/ 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. gcc/fortran 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. From-SVN: r173385
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/invoke.texi3
-rw-r--r--gcc/fortran/options.c5
3 files changed, 14 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9544af2..5ab6e33 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 0874e5c..d24c2f2 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -1488,7 +1488,8 @@ levels such that the compiler does not do any re-association. Using
@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}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index f56fad7..e274572 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -151,7 +151,7 @@ gfc_init_options (unsigned int decoded_options_count,
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;
@@ -272,6 +272,9 @@ gfc_post_options (const char **pfilename)
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)