Commit 321bff11 by Joost VandeVondele Committed by Joost VandeVondele

options.c (gfc_init_options_struct): assert that the frontend sets…

options.c (gfc_init_options_struct): assert that the frontend sets flag_errno_math and flag_associative_math.

gcc/fortran/ChangeLog:

2014-08-20  Joost VandeVondele  <Joost.VandeVondele@mat.ethz.ch>

	* options.c (gfc_init_options_struct): assert that the frontend sets
        flag_errno_math and flag_associative_math.

gcc/testsuite/ChangeLog:

2014-08-20  Joost VandeVondele  <Joost.VandeVondele@mat.ethz.ch>

	* gfortran.dg/errnocheck_1.f90: New test.
	* gfortran.dg/associative_1.f90: New test.

From-SVN: r214211
parent dd3ff077
2014-08-20 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
* options.c (gfc_init_options_struct): assert that the frontend sets
flag_errno_math and flag_associative_math.
2014-08-17 Tobias Burnus <burnus@net-b.de>
* resolve.c (gfc_resolve_finalizers): Ensure that parents are
......
......@@ -66,7 +66,9 @@ void
gfc_init_options_struct (struct gcc_options *opts)
{
opts->x_flag_errno_math = 0;
opts->frontend_set_flag_errno_math = true;
opts->x_flag_associative_math = -1;
opts->frontend_set_flag_associative_math = true;
}
/* Get ready for options handling. Keep in sync with
......
2014-08-20 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
* gfortran.dg/errnocheck_1.f90: New test.
* gfortran.dg/associative_1.f90: New test.
2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR preprocessor/51303
......
! { dg-do compile }
! { dg-options "-O1 -fno-signed-zeros -fno-trapping-math -fdump-tree-optimized" }
! Fortran defaults to associative by default,
! with -fno-signed-zeros -fno-trapping-math this should optimize away all additions
SUBROUTINE S1(a)
REAL :: a
a=1+a-1
END SUBROUTINE S1
! { dg-final { scan-tree-dump-times " \\\+ " 0 "optimized" } }
! { dg-final { cleanup-tree-dump "optimized" } }
! { dg-do compile { target x86_64-*-* } }
! Fortran should default to -fno-math-errno
! and thus no call to sqrt in asm
subroutine mysqrt(a)
real(KIND=KIND(0.0D0)) :: a
a=sqrt(a)
end subroutine
! { dg-final { scan-assembler-times "call" 0 } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment