This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH, Fortan] fix initialization of flag_errno_math and flag_associative_math
- From: "VandeVondele Joost" <joost dot vandevondele at mat dot ethz dot ch>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Jun 2014 06:07:54 +0000
- Subject: RE: [PATCH, Fortan] fix initialization of flag_errno_math and flag_associative_math
- Authentication-results: sourceware.org; auth=none
- References: <20140531110117 dot 8819D105 at mailhost dot lps dot ens dot fr>
> Why do you want -fno-math-errno to be the default for gfortran?
because it was with rth's commit? This makes sense also because errno is a variable that is defined for C, and not accessible from Fortran. Why would you want -fmath-errno to be the default ?
> if (flag_associative_math == -1)
> flag_associative_math = (!flag_trapping_math && !flag_signed_zeros);
> Why this is not working is beyond my understanding, but I am not sure that your fix is the right one.
while the details of the option handling are rather opaque to me to, at the point of reaching this statement, flag_associative_math currently equals 0 or 1 even if the user didn't specify the flag. I believe as set by common_handle_option. With my patch, the value of -1 is seen when the user did not specify the flag explicitly.
Note that the go frontend uses a similar approach for errno.
Joost