diff mbox series

[fortran] Fix PR 91783

Message ID 60285894-9bf4-f78b-4dae-ff903b189c41@netcologne.de
State New
Headers show
Series [fortran] Fix PR 91783 | expand

Commit Message

Thomas Koenig Nov. 24, 2019, 5:09 p.m. UTC
Hello world,

this patch fixes a 10 regression in dependency checking. The
approach is simple - if gfc_dep_resolver is handed references
with _data, remove that.

Regression-tested. OK for trunk?

Regards

	Thomas

Do not look at _data component in gfc_dep_resolver.

2019-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/91783
	* dependency.c (gfc_dep_resolver): Do not look at _data
	component if present.

2019-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/91783
	* gfortran.dg/dependency_56.f90: New test.

Comments

Thomas Koenig Nov. 29, 2019, 8:40 p.m. UTC | #1
Am 24.11.19 um 18:09 schrieb Thomas Koenig:
> Hello world,
> 
> this patch fixes a 10 regression in dependency checking. The
> approach is simple - if gfc_dep_resolver is handed references
> with _data, remove that.
> 
> Regression-tested. OK for trunk?

Ping?
Paul Richard Thomas Nov. 30, 2019, 3:34 p.m. UTC | #2
Hi Thomas,

This is OK for trunk.

Thanks for the patch

Paul

On Sun, 24 Nov 2019 at 17:10, Thomas Koenig <tkoenig@netcologne.de> wrote:
>
> Hello world,
>
> this patch fixes a 10 regression in dependency checking. The
> approach is simple - if gfc_dep_resolver is handed references
> with _data, remove that.
>
> Regression-tested. OK for trunk?
>
> Regards
>
>         Thomas
>
> Do not look at _data component in gfc_dep_resolver.
>
> 2019-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/91783
>         * dependency.c (gfc_dep_resolver): Do not look at _data
>         component if present.
>
> 2019-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/91783
>         * gfortran.dg/dependency_56.f90: New test.
>
>
diff mbox series

Patch

Index: fortran/dependency.c
===================================================================
--- fortran/dependency.c	(Revision 278025)
+++ fortran/dependency.c	(Arbeitskopie)
@@ -2098,6 +2098,18 @@  gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf
   gfc_dependency this_dep;
   bool same_component = false;
 
+  /* The refs might come in mixed, one with a _data component and one
+     without.  Look at their next reference in order to avoid an
+     ICE.  */
+
+  if (lref && lref->type == REF_COMPONENT && lref->u.c.component
+      && strcmp (lref->u.c.component->name, "_data") == 0)
+    lref = lref->next;
+
+  if (rref && rref->type == REF_COMPONENT && rref->u.c.component
+      && strcmp (rref->u.c.component->name, "_data") == 0)
+    rref = rref->next;
+
   this_dep = GFC_DEP_ERROR;
   fin_dep = GFC_DEP_ERROR;
   /* Dependencies due to pointers should already have been identified.