[PR,57801] Waste work in resolve_variable()
diff mbox

Message ID 40d845468ae8e260ff740716b1258376.squirrel@webmail.cs.wisc.edu
State New
Headers show

Commit Message

pchang9@cs.wisc.edu July 23, 2013, 9:39 p.m. UTC
Hi,

The problem appears in revision 201034 in version 4.9. I attached a
one-line patch that fixes it.  I also reported this problem
at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57801

Bootstrap and regression-tested on x86_64-linux.

In method "resolve_variable()" in gcc/fortran/resolve.c, the loop on
line 4908 should break immediately after "seen" is set to "true".


2013-07-23  Chang  <pchang9@cs.wisc.edu>

        * resolve.c (resolve_variable): Exit loop after setting seen.




-Chang
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 201034)
+++ gcc/fortran/resolve.c	(working copy)
@@ -4908,7 +4908,10 @@
 	    for (formal = entry->sym->formal; formal; formal = formal->next)
 	      {
 		if (formal->sym && sym->name == formal->sym->name)
-		  seen = true;
+		  {
+		    seen = true;
+		    break;
+		  }
 	      }
 
 	  /*  If it has not been seen as a dummy, this is an error.  */

Comments

Jeff Law July 29, 2013, 7:09 p.m. UTC | #1
On 07/23/2013 03:39 PM, pchang9@cs.wisc.edu wrote:
> Hi,
>
> The problem appears in revision 201034 in version 4.9. I attached a
> one-line patch that fixes it.  I also reported this problem
> at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57801
>
> Bootstrap and regression-tested on x86_64-linux.
>
> In method "resolve_variable()" in gcc/fortran/resolve.c, the loop on
> line 4908 should break immediately after "seen" is set to "true".
>
>
> 2013-07-23  Chang  <pchang9@cs.wisc.edu>
>
>          * resolve.c (resolve_variable): Exit loop after setting seen.
Installed.  Thanks.

jeff

Patch
diff mbox

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 201034)
+++ gcc/fortran/resolve.c	(working copy)
@@ -4908,7 +4908,10 @@ 
 	    for (formal = entry->sym->formal; formal; formal = formal->next)
 	      {
 		if (formal->sym && sym->name == formal->sym->name)
-		  seen = true;
+		  {
+		    seen = true;
+		    break;
+		  }
 	      }

 	  /*  If it has not been seen as a dummy, this is an error.  */