diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 74bfa1a0ec15..af6bc8a703e0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2005-04-10 Francois-Xavier Coudert + + * match.c (match_arithmetic_if): Arithmetic IF is obsolete in + Fortran 95. + 2005-04-09 Steven G. Kargl * simplify.c (gfc_simplify_anint): Use mpfr_round() diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 0a173b86ea0d..d81686bb134e 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -922,6 +922,10 @@ match_arithmetic_if (void) return MATCH_ERROR; } + if (gfc_notify_std (GFC_STD_F95_DEL, + "Obsolete: arithmetic IF statement at %C") == FAILURE) + return MATCH_ERROR; + new_st.op = EXEC_ARITHMETIC_IF; new_st.expr = expr; new_st.label = l1; @@ -993,6 +997,11 @@ gfc_match_if (gfc_statement * if_type) gfc_free_expr (expr); return MATCH_ERROR; } + + if (gfc_notify_std (GFC_STD_F95_DEL, + "Obsolete: arithmetic IF statement at %C") + == FAILURE) + return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; new_st.expr = expr; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a55aec878465..9d3c99f80b20 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-10 Francois-Xavier Coudert + + * gfortran.dg/pr17229.f: Take care of the new obsolescence + warning for arithmetic IF statements. + 2005-04-10 Thomas Koenig * eor_handling_1.f90: New test case. diff --git a/gcc/testsuite/gfortran.dg/pr17229.f b/gcc/testsuite/gfortran.dg/pr17229.f index b1a4471e410a..4e96d29921a4 100644 --- a/gcc/testsuite/gfortran.dg/pr17229.f +++ b/gcc/testsuite/gfortran.dg/pr17229.f @@ -5,18 +5,18 @@ l = .false. i = -1 - if (l) if (i) 999,999,999 + if (l) if (i) 999,999,999 ! { dg-warning "Obsolete: arithmetic IF statement" } l = .true. - if (l) if (i) 10,999,999 + if (l) if (i) 10,999,999 ! { dg-warning "Obsolete: arithmetic IF statement" } go to 999 10 i = 0 - if (l) if (i) 999,20,999 + if (l) if (i) 999,20,999 ! { dg-warning "Obsolete: arithmetic IF statement" } go to 999 20 i = 1 - if (l) if (i) 999,999,30 + if (l) if (i) 999,999,30 ! { dg-warning "Obsolete: arithmetic IF statement" } go to 999 999 call abort