aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@gcc.gnu.org>2010-05-20 09:49:26 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2010-05-20 09:49:26 +0200
commitfeef2551ec8f4ce562348dac418d8aa4329a9f68 (patch)
treecd7a498f826c9bf0945eb06cd14fee797a843d47 /gcc/fortran/options.c
parent9af157ac129e480fa652936b43509ff0faef9dff (diff)
downloadgcc-feef2551ec8f4ce562348dac418d8aa4329a9f68.zip
gcc-feef2551ec8f4ce562348dac418d8aa4329a9f68.tar.gz
gcc-feef2551ec8f4ce562348dac418d8aa4329a9f68.tar.bz2
options.c (gfc_init_options,gfc_post_options): Enable flag_associative_math by default.
2010-05-20 Tobias Burnus <burnus@net-b.de> * options.c (gfc_init_options,gfc_post_options): Enable flag_associative_math by default. From-SVN: r159620
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 320dc72..365b326 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -134,6 +134,7 @@ gfc_init_options (unsigned int argc, const char **argv)
gfc_option.coarray = GFC_FCOARRAY_NONE;
flag_errno_math = 0;
+ flag_associative_math = -1;
set_default_std_flags ();
@@ -247,6 +248,11 @@ gfc_post_options (const char **pfilename)
if (flag_lto || flag_whopr)
gfc_option.flag_whole_file = 1;
+ /* Fortran allows associative math - but we cannot reassociate if
+ we want traps or signed zeros. Cf. also flag_protect_parens. */
+ if (flag_associative_math == -1)
+ flag_associative_math = (!flag_trapping_math && !flag_signed_zeros);
+
/* -fbounds-check is equivalent to -fcheck=bounds */
if (flag_bounds_check)
gfc_option.rtcheck |= GFC_RTCHECK_BOUNDS;