commit 627d59b6b3062de921fbdd80b2b48de18f599d03
Author: Tobias Burnus <tobias@codesourcery.com>
Date: Tue Jan 28 11:54:57 2020 +0100
[Fortran] avoid ICE in gfc_omp_check_optional_argument (PR93464)
PR fortran/93464
* openmp.c (gfc_omp_check_optional_argument): Avoid ICE when
DECL_LANG_SPECIFIC and GFC_DESCRIPTOR_TYPE_P but not
GFC_DECL_SAVED_DESCRIPTOR as for local allocatable character vars.
PR fortran/93464
* gfortran.dg/goacc/pr93464.f90: New.
@@ -1,9 +1,16 @@
+2020-01-28 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93464
+ * openmp.c (gfc_omp_check_optional_argument): Avoid ICE when
+ DECL_LANG_SPECIFIC and GFC_DESCRIPTOR_TYPE_P but not
+ GFC_DECL_SAVED_DESCRIPTOR as for local allocatable character vars.
+
2020-01-28 Tobias Burnus <tobias@codesourcery.com>
* gfortran.texi (Runtime): Remove tailing '.' in @menu.
2020-01-27 Tobias Burnus <tobias@codesourcery.com>
PR fortran/85781
* trans-expr.c (gfc_conv_substring): Handle non-ARRAY_TYPE strings
of Bind(C) procedures.
@@ -95,19 +95,20 @@ gfc_omp_check_optional_argument (tree decl, bool for_present_check)
/* For assumed-shape arrays, a local decl with arg->data is used. */
if (TREE_CODE (decl) != PARM_DECL
&& (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
|| GFC_ARRAY_TYPE_P (TREE_TYPE (decl))))
{
is_array_type = true;
decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
}
- if (TREE_CODE (decl) != PARM_DECL
+ if (decl == NULL_TREE
+ || TREE_CODE (decl) != PARM_DECL
|| !DECL_LANG_SPECIFIC (decl)
|| !GFC_DECL_OPTIONAL_ARGUMENT (decl))
return NULL_TREE;
/* Scalars with VALUE attribute which are passed by value use a hidden
argument to denote the present status. They are passed as nonpointer type
with one exception: 'type(c_ptr), value' as 'void*'. */
/* Cf. trans-expr.c's gfc_conv_expr_present. */
if (TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE
@@ -1,9 +1,14 @@
+2020-01-28 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93464
+ * gfortran.dg/goacc/pr93464.f90: New.
+
2020-01-28 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/93434
* gcc.c-torture/execute/pr93434.c: New test.
2020-01-28 Richard Sandiford <richard.sandiford@arm.com>
PR testsuite/93460
* gcc.dg/torture/pr93170.c: Add -Wpsabi.
new file mode 100644
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR fortran/93464
+!
+! Contributed by G. Steinmetz
+!
+program p
+ character :: c(2) = 'a'
+ character, allocatable :: z(:)
+ !$acc parallel
+ !$omp target
+ z = c
+ !$acc end parallel
+ !$omp end target
+ print *, z
+end