Commit 396e56d2 by Thomas Koenig

re PR fortran/67219 (Incorrect conversion warning)

2016-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/67219
	* arith.c (gfc_int2real):  Change gfc_warning_now
	to gfc_warning.
	* primary.c (match_complex_constant):  If there
	is no comma, throw away any warning which might have
	been issued by gfc_int2real.

2016-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/67219
	* gfortran.dg/pr67219.f90:  New test.

From-SVN: r241689
parent e9d33505
2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/67219
* arith.c (gfc_int2real): Change gfc_warning_now
to gfc_warning.
* primary.c (match_complex_constant): If there
is no comma, throw away any warning which might have
been issued by gfc_int2real.
2016-10-28 Steven G. Kargl <kargl@gcc.gnu.org> 2016-10-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71891 PR fortran/71891
......
...@@ -2072,11 +2072,11 @@ gfc_int2real (gfc_expr *src, int kind) ...@@ -2072,11 +2072,11 @@ gfc_int2real (gfc_expr *src, int kind)
if (warn_conversion if (warn_conversion
&& wprecision_int_real (src->value.integer, result->value.real)) && wprecision_int_real (src->value.integer, result->value.real))
gfc_warning_now (OPT_Wconversion, "Change of value in conversion " gfc_warning (OPT_Wconversion, "Change of value in conversion "
"from %qs to %qs at %L", "from %qs to %qs at %L",
gfc_typename (&src->ts), gfc_typename (&src->ts),
gfc_typename (&result->ts), gfc_typename (&result->ts),
&src->where); &src->where);
return result; return result;
} }
......
...@@ -1353,6 +1353,10 @@ match_complex_constant (gfc_expr **result) ...@@ -1353,6 +1353,10 @@ match_complex_constant (gfc_expr **result)
if (gfc_match_char (',') == MATCH_NO) if (gfc_match_char (',') == MATCH_NO)
{ {
/* It is possible that gfc_int2real issued a warning when
converting an integer to real. Throw this away here. */
gfc_clear_warning ();
gfc_pop_error (&old_error); gfc_pop_error (&old_error);
m = MATCH_NO; m = MATCH_NO;
goto cleanup; goto cleanup;
......
2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/67219
* gfortran.dg/pr67219.f90: New test.
2016-10-29 Jakub Jelinek <jakub@redhat.com> 2016-10-29 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/77919 PR rtl-optimization/77919
......
! { dg-do compile }
! PR 67149 - this used to throw a spurious error.
function foo(bar)
integer(8) :: foo
integer(4), intent(in) :: bar
integer(4), parameter :: huge_4 = huge(0_4)
foo = (huge_4 - int(bar,kind=8))
end function
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