This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Don't forget to pop timevar


On 21 Dec, Mark Mitchell wrote:
> Gabriel Dos Reis wrote:
>> Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:
>> 
>> | Right at the beginning of the function pushtag in cp/name-lookup.c
>> | we have "timevar_push (TV_NAME_LOOKUP);". However, we leave the
>> | function in one path without popping the variable again. Only
>> | mainline is affected.
>> | 
>> | The following patch fixes that.
>> | 
>> | Ok to commit once bootstrapping and regtesting succeeded?
>> 
>> I think the patch qualifies as obvious, and being the perpetrator of
>> POP_TIMEVAR_AND_RETURN I believe the patch is fine.  And it fixes a
>> bug (my understanding is that we're back to bug-fixing mode).
> 
> No, we're not, unless I announced that without remembering it.  It's my 
> belief that we're supposed to be still fixing regressions.
> 
> But, this patch is certainly obvious enough that we may as well put it in.

Committed.

Mark, what about the cleanup I mentioned (i.e. the patch below)?

Regards,
Volker


2004-12-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* decl.c (define_label): Use POP_TIMEVAR_AND_RETURN.
	* name-lookup.c (pushdecl_class_level): Likewise.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1344
diff -u -p -r1.1344 decl.c
--- decl.c	21 Dec 2004 17:54:22 -0000	1.1344
+++ decl.c	22 Dec 2004 02:15:47 -0000
@@ -2431,8 +2431,7 @@ define_label (location_t location, tree 
       check_previous_gotos (decl);
     }
 
-  timevar_pop (TV_NAME_LOOKUP);
-  return decl;
+  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
 }
 
 struct cp_switch
Index: name-lookup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/name-lookup.c,v
retrieving revision 1.102
diff -u -p -r1.102 name-lookup.c
--- name-lookup.c	22 Dec 2004 02:11:35 -0000	1.102
+++ name-lookup.c	22 Dec 2004 02:15:47 -0000
@@ -2480,9 +2480,7 @@ pushdecl_class_level (tree x)
 	  input_location = save_location;
 	}
     }
-  timevar_pop (TV_NAME_LOOKUP);
-
-  return is_valid;
+  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, is_valid);
 }
 
 /* Return the BINDING (if any) for NAME in SCOPE, which is a class
===================================================================



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]