Fix an ICE found in PR93686

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix an ICE found in PR93686

gcc - fortran mailing list
This patch fixes the ICE found in PR93686.


Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 280157)
+++ gcc/fortran/decl.c (working copy)
@@ -696,6 +696,10 @@ gfc_match_data (void)
   /* F2008:C567 (R536) A data-i-do-object or a variable that appears
      as a data-stmt-object shall not be an object designator in which
      a pointer appears other than as the entire rightmost part-ref.  */
+  if (!e->ref && e->ts.type == BT_DERIVED
+      && e->symtree->n.sym->attr.pointer)
+    goto partref;
+
   ref = e->ref;
   if (e->symtree->n.sym->ts.type == BT_DERIVED
       && e->symtree->n.sym->attr.pointer

--
Steve
Reply | Threaded
Open this post in threaded view
|

Re: Fix an ICE found in PR93686

gcc - fortran mailing list
On Sat, Apr 4, 2020 at 2:58 PM Steve Kargl via Fortran
<[hidden email]> wrote:

>
> This patch fixes the ICE found in PR93686.
>
>
> Index: gcc/fortran/decl.c
> ===================================================================
> --- gcc/fortran/decl.c  (revision 280157)
> +++ gcc/fortran/decl.c  (working copy)
> @@ -696,6 +696,10 @@ gfc_match_data (void)
>           /* F2008:C567 (R536) A data-i-do-object or a variable that appears
>              as a data-stmt-object shall not be an object designator in which
>              a pointer appears other than as the entire rightmost part-ref.  */
> +         if (!e->ref && e->ts.type == BT_DERIVED
> +             && e->symtree->n.sym->attr.pointer)
> +           goto partref;
> +
>           ref = e->ref;
>           if (e->symtree->n.sym->ts.type == BT_DERIVED
>               && e->symtree->n.sym->attr.pointer
>
> --
> Steve

LGTM, thanks for the patch. I will commit along with the testcases from the PR.

---
Fritz