diff mbox

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

Message ID 1283887795.3786.38.camel@linux-fd1f.site
State New
Headers show

Commit Message

Thomas Koenig Sept. 7, 2010, 7:29 p.m. UTC
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.

Comments

Mikael Morin Sept. 7, 2010, 10:14 p.m. UTC | #1
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. UTC | #2
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
diff mbox

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;
 	    }