re PR fortran/77372 (ICE in simplify_ieee_selected_real_kind, at fortran/simplify.c:7049)

2016-08-27  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/77372
	simplify.c (simplify_ieee_selected_real_kind): Check for NULL pointers.

2016-08-27  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/77372
	gfortran.dg/pr77372.f90: New test.

From-SVN: r239795
This commit is contained in:
Steven G. Kargl 2016-08-27 15:38:55 +00:00
parent 4aebb4e4a6
commit 741b52b54f
4 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2016-08-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77372
simplify.c (simplify_ieee_selected_real_kind): Check for NULL pointers.
2016-08-25 Steven g. Kargl <kargl@gcc.gnu.org>
PR fortran/77351

View File

@ -7044,9 +7044,17 @@ gfc_simplify_compiler_version (void)
gfc_expr *
simplify_ieee_selected_real_kind (gfc_expr *expr)
{
gfc_actual_arglist *arg = expr->value.function.actual;
gfc_expr *p = arg->expr, *q = arg->next->expr,
*rdx = arg->next->next->expr;
gfc_actual_arglist *arg;
gfc_expr *p = NULL, *q = NULL, *rdx = NULL;
arg = expr->value.function.actual;
p = arg->expr;
if (arg->next)
{
q = arg->next->expr;
if (arg->next->next)
rdx = arg->next->next->expr;
}
/* Currently, if IEEE is supported and this module is built, it means
all our floating-point types conform to IEEE. Hence, we simply handle

View File

@ -1,3 +1,8 @@
2016-08-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77372
gfortran.dg/pr77372.f90: New test.
2016-08-26 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/spellcheck-fields-2.c (test): Move

View File

@ -0,0 +1,7 @@
! { dg-do compile }
program p
use ieee_arithmetic
real(kind=ieee_selected_real_kind(10_1)) :: z1
real(kind=ieee_selected_real_kind(10_2)) :: z2
real(kind=ieee_selected_real_kind(10_4)) :: z4
end