Patchwork [fortran] Fix PR 45576 (Regression involving char lengths)

login
register
mail settings
Submitter Thomas Koenig
Date Sept. 7, 2010, 7:29 p.m.
Message ID <1283887795.3786.38.camel@linux-fd1f.site>
Download mbox | patch
Permalink /patch/64056/
State New
Headers show

Comments

Thomas Koenig - Sept. 7, 2010, 7:29 p.m.
Hello world,

this fixes a regression introduced by my changes to gfc_deb_compare_expr
and exposed by my recent changes to string comparison.

OK for trunk?

	Thomas

2010-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45576
	* dependency.c (gfc_deb_compare_expr):  Take missing optional
	arguments into account.

2010-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45576
	* gfortran.dg/char_length_18.f90:  New test.
Mikael Morin - Sept. 7, 2010, 10:14 p.m.
Le 07.09.2010 21:29, Thomas Koenig a écrit :
> Hello world,
>
> this fixes a regression introduced by my changes to gfc_deb_compare_expr
> and exposed by my recent changes to string comparison.
>
> OK for trunk?
>

OK.
Thomas Koenig - Sept. 7, 2010, 10:51 p.m.
Hello Mikael,

> Le 07.09.2010 21:29, Thomas Koenig a écrit :
> > Hello world,
> >
> > this fixes a regression introduced by my changes to gfc_deb_compare_expr
> > and exposed by my recent changes to string comparison.
> >
> > OK for trunk?
> >
> 
> OK.

Sende          fortran/ChangeLog
Sende          fortran/dependency.c
Sende          testsuite/ChangeLog
Hinzufügen     testsuite/gfortran.dg/char_length_18.f90
Übertrage Daten ....
Revision 163978 übertragen.

Thanks for the review!

	Thomas

Patch

Index: dependency.c
===================================================================
--- dependency.c	(Revision 163868)
+++ dependency.c	(Arbeitskopie)
@@ -368,8 +368,14 @@  gfc_dep_compare_expr (gfc_expr *e1, gfc_expr *e2)
 	  /* Compare the argument lists for equality.  */
 	  while (args1 && args2)
 	    {
-	      if (gfc_dep_compare_expr (args1->expr, args2->expr) != 0)
+	      /* Bitwise xor, since C has no non-bitwise xor operator.  */
+	      if ((args1->expr == NULL) ^ (args2->expr == NULL))
 		return -2;
+
+	      if (args1->expr != NULL && args2->expr != NULL
+		  && gfc_dep_compare_expr (args1->expr, args2->expr) != 0)
+		return -2;
+
 	      args1 = args1->next;
 	      args2 = args2->next;
 	    }