re PR fortran/61454 (ICE in simplification of initialization expression with array)

PR fortran/61454
	* expr.c (scalarize_intrinsic_call): Take care of optional
	arguments.
	* gfortran.dg/pr61454.f90: New file.

From-SVN: r211822
This commit is contained in:
Francois-Xavier Coudert 2014-06-19 11:58:55 +00:00 committed by François-Xavier Coudert
parent c7744b8eea
commit c8d599e1dd
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-06-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/61454
* expr.c (scalarize_intrinsic_call): Take care of optional
arguments.
2014-06-19 Tobias Burnus <burnus@net-b.de>
* trans-intrinsic.c (conv_co_minmaxsum): Fix argument

View File

@ -1955,7 +1955,7 @@ scalarize_intrinsic_call (gfc_expr *e)
for (; a; a = a->next)
{
n++;
if (a->expr->expr_type != EXPR_ARRAY)
if (!a->expr || a->expr->expr_type != EXPR_ARRAY)
continue;
array_arg = n;
expr = gfc_copy_expr (a->expr);

View File

@ -1,3 +1,8 @@
2014-06-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/61454
* gfortran.dg/pr61454.f90: New file.
2014-06-19 Terry Guo <terry.guo@arm.com>
* gcc.target/arm/thumb1-load-64bit-constant-1.c: New test.

View File

@ -0,0 +1,14 @@
! { dg-do compile }
implicit none
integer, parameter :: arr(2) = [ 1, 3 ]
real, parameter :: arr2(2) = [ 1.5, 2.1 ]
integer, parameter :: j = int(sum(arr))
integer, parameter :: k = ceiling(sum(arr2))
real(kind=j) :: x1
real(kind=k) :: x2
print *, j, k
print *, x1, x2
end