]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/61454 (ICE in simplification of initialization expression with array)
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 19 Jun 2014 11:58:55 +0000 (11:58 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 19 Jun 2014 11:58:55 +0000 (11:58 +0000)
PR fortran/61454
* expr.c (scalarize_intrinsic_call): Take care of optional
arguments.
* gfortran.dg/pr61454.f90: New file.

From-SVN: r211822

gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr61454.f90 [new file with mode: 0644]

index 903e9ab250588cad8a8a6c20889a32da65db9290..6325c50a6e0de731f6001b814c109d635905caa1 100644 (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
index f6772047e270d00d3ff48d6aeb159c099481bb25..f0238c1b97ec1569d058f0e22b352a9453401211 100644 (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);
index 5138e5a9641d0b4c537ece2db95556744e0520e1..5d58712f7e4583ee7bd255584270cb3f9a644963 100644 (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.
diff --git a/gcc/testsuite/gfortran.dg/pr61454.f90 b/gcc/testsuite/gfortran.dg/pr61454.f90
new file mode 100644 (file)
index 0000000..75e4572
--- /dev/null
@@ -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
This page took 0.094051 seconds and 5 git commands to generate.