diff mbox

[4.6] Do not create new cgraph noes in the verifier

Message ID 20110311094324.GA28608@virgil.arch.suse.de
State New
Headers show

Commit Message

Martin Jambor March 11, 2011, 9:43 a.m. UTC
Hi,

while working on removing lazy cgraph node creation I have noticed
that we might do that even in the call graph verifier which certainly
looks undesirable.  Richi pre-approved removing it on IRC but I am not
sure whether that was for 4.6.  On the other hand I guess the change
is rather obvious and the verifier is disabled with release checking
and so I'd prefer to commit it now.  Is it OK?

Bootstrapped and tested on x86_63-linux without any problems.

Thanks,

Martin


2011-03-10  Martin Jambor  <mjambor@suse.cz>

	* cgraphunit.c (verify_cgraph_node): Call cgraph_get_node instead of
	cgraph_node.

Comments

Richard Biener March 11, 2011, 10:23 a.m. UTC | #1
On Fri, 11 Mar 2011, Martin Jambor wrote:

> Hi,
> 
> while working on removing lazy cgraph node creation I have noticed
> that we might do that even in the call graph verifier which certainly
> looks undesirable.  Richi pre-approved removing it on IRC but I am not
> sure whether that was for 4.6.  On the other hand I guess the change
> is rather obvious and the verifier is disabled with release checking
> and so I'd prefer to commit it now.  Is it OK?
> 
> Bootstrapped and tested on x86_63-linux without any problems.

Ok.

Thanks,
Richard.


> Thanks,
> 
> Martin
> 
> 
> 2011-03-10  Martin Jambor  <mjambor@suse.cz>
> 
> 	* cgraphunit.c (verify_cgraph_node): Call cgraph_get_node instead of
> 	cgraph_node.
> 
> Index: src/gcc/cgraphunit.c
> ===================================================================
> --- src.orig/gcc/cgraphunit.c
> +++ src/gcc/cgraphunit.c
> @@ -551,7 +551,7 @@ verify_cgraph_node (struct cgraph_node *
>        error_found = true;
>      }
>  
> -  if (!cgraph_node (node->decl))
> +  if (!cgraph_get_node (node->decl))
>      {
>        error ("node not found in cgraph_hash");
>        error_found = true;
> 
>
Jan Hubicka March 11, 2011, 2:21 p.m. UTC | #2
> Hi,
> 
> while working on removing lazy cgraph node creation I have noticed
> that we might do that even in the call graph verifier which certainly
> looks undesirable.  Richi pre-approved removing it on IRC but I am not
> sure whether that was for 4.6.  On the other hand I guess the change
> is rather obvious and the verifier is disabled with release checking
> and so I'd prefer to commit it now.  Is it OK?

Yes it is OK.
Obviously that code never creates new nodes unless the cgraph hash is memory corrupted,
but it also never produce the error message.
Originaly the code was testing cgraph_get_node (node->decl) != node
and it was intended to check sanity of cgraph hash table at a time it was identifier
based and we was not pretending we have one definition rule.

Honza
> 
> Bootstrapped and tested on x86_63-linux without any problems.
> 
> Thanks,
> 
> Martin
> 
> 
> 2011-03-10  Martin Jambor  <mjambor@suse.cz>
> 
> 	* cgraphunit.c (verify_cgraph_node): Call cgraph_get_node instead of
> 	cgraph_node.
> 
> Index: src/gcc/cgraphunit.c
> ===================================================================
> --- src.orig/gcc/cgraphunit.c
> +++ src/gcc/cgraphunit.c
> @@ -551,7 +551,7 @@ verify_cgraph_node (struct cgraph_node *
>        error_found = true;
>      }
>  
> -  if (!cgraph_node (node->decl))
> +  if (!cgraph_get_node (node->decl))
>      {
>        error ("node not found in cgraph_hash");
>        error_found = true;
diff mbox

Patch

Index: src/gcc/cgraphunit.c
===================================================================
--- src.orig/gcc/cgraphunit.c
+++ src/gcc/cgraphunit.c
@@ -551,7 +551,7 @@  verify_cgraph_node (struct cgraph_node *
       error_found = true;
     }
 
-  if (!cgraph_node (node->decl))
+  if (!cgraph_get_node (node->decl))
     {
       error ("node not found in cgraph_hash");
       error_found = true;