[PATCH] Verify that the result of a phi node is an SSA_NAME

Martin Jambor mjambor@suse.cz
Wed Sep 9 14:21:00 GMT 2009


Hi,

the patch below verifies that the result of a phi node is an SSA_NAME
rather than a "gimple_variable" which can also be a
{VAR,PARM,RESULT}_DECL.

It does not really change anything but since the verifier is also our
gimple grammar documentation, I thought it was worth to change it.

Bootstrapped and tested on x86_64-linux, OK for trunk?

Thanks,

Martin


2009-09-09  Martin Jambor  <mjambor@suse.cz>

	* tree-cfg.c (verify_gimple_phi): Check that gimple_phi_result is
	an SSA_NAME rather than a is_gimple_variable.


Index: small/gcc/tree-cfg.c
===================================================================
--- small.orig/gcc/tree-cfg.c
+++ small/gcc/tree-cfg.c
@@ -4143,7 +4143,7 @@ verify_gimple_phi (gimple stmt)
   tree type = TREE_TYPE (gimple_phi_result (stmt));
   unsigned i;
 
-  if (!is_gimple_variable (gimple_phi_result (stmt)))
+  if (TREE_CODE (gimple_phi_result (stmt)) != SSA_NAME)
     {
       error ("Invalid PHI result");
       return true;



More information about the Gcc-patches mailing list