[LTO][PATCH] Fix for LTO ICE for mixed optimization compilations

Andrew MacLeod amacleod@redhat.com
Mon Jan 19 20:29:00 GMT 2009

Simon Baldwin wrote:
> This patch fixes an LTO ICE that occurs where pickled IL generated with -O1
> is processed later on by lto1 without optimization (-O0).
> The patch works by skipping SSA names for debugging if they do not map to a
> partition.  This is the same check as made elsewhere in this module.
> Index: gcc/tree-ssa-coalesce.c
> ===================================================================
> --- gcc/tree-ssa-coalesce.c	(revision 143457)
> +++ gcc/tree-ssa-coalesce.c	(working copy)
> @@ -1355,7 +1355,8 @@ coalesce_ssa_name (void)
>  	{
>  	  tree a = ssa_name (i);
> -	  if (a && SSA_NAME_VAR (a) && !DECL_ARTIFICIAL (SSA_NAME_VAR (a)))
> +	  if (a && SSA_NAME_VAR (a) && !DECL_ARTIFICIAL (SSA_NAME_VAR (a))
> +	      && map->partition_to_var[i] != NULL)
>  	    {
>  	      tree *slot = (tree *) htab_find_slot (ssa_name_hash, a, INSERT);
So you end up with SSA_NAMEs which have been eliminated from the IL via 
optimization, and which this code for the non-optimized path assumes can 
never happen?  I didn't write the non-optimized hunk, but it appears to 
make the assumption that all SSA_NAMEs are still in the IL.  
partition_to_var[] should be non-null for any SSA_NAME which is still in 
the IL, even at -O0. So unless honza has something else to add...

This seems OK to me.



More information about the Gcc-patches mailing list