re PR fortran/71085 (ICE with some intrinsic functions specifying array function...
authorHarald Anlauf <anlauf@gmx.de>
Sun, 4 Mar 2018 01:37:13 +0000 (01:37 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sun, 4 Mar 2018 01:37:13 +0000 (01:37 +0000)
2018-03-03  Harald Anlauf  <anlauf@gmx.de>

PR fortran/71085
* trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
dereference NULL pointer.

2018-03-03  Harald Anlauf  <anlauf@gmx.de>

PR fortran/71085
* gfortran.dg/pr71085.f90: New test.

From-SVN: r258228

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

index eb64c7452f173c84c7715a0e2dee5c68d26c51ec..9a5b5670b0231e92d92819e2cad635edb5fa421e 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/71085
+       * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
+       dereference NULL pointer.
+
 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66128
index a93257c73bfd17f3c22360bc3154df865a22ec92..c84cd107370f1a02eeaf8d85e6cd5fbda19fd14a 100644 (file)
@@ -4349,6 +4349,8 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping,
 
       if (expr->value.function.esym == NULL
            && expr->value.function.isym != NULL
+           && expr->value.function.actual
+           && expr->value.function.actual->expr
            && expr->value.function.actual->expr->symtree
            && gfc_map_intrinsic_function (expr, mapping))
        break;
index 45b72e5037f656893c46153da5b9bd2f07088e68..63adcbe988e1d45da0babc411641b9f4b60a3776 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/71085
+       * gfortran.dg/pr71085.f90: New test.
+
 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66128
diff --git a/gcc/testsuite/gfortran.dg/pr71085.f90 b/gcc/testsuite/gfortran.dg/pr71085.f90
new file mode 100644 (file)
index 0000000..11d9850
--- /dev/null
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR 71085
+!
+! Testcase from PR by Vladimir Fuka <vladimir.fuka@gmail.com>
+!
+program pr71085
+  print *, f()
+contains
+  function f()
+    integer :: f(iargc()*10)
+  end
+end