This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Put scope blocks on a diet
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 09 Oct 2007 18:09:24 -0300
- Subject: Re: Put scope blocks on a diet
- References: <20070724180235.GM24519@kam.mff.cuni.cz> <orlkcucny9.fsf@oliva.athome.lsd.ic.unicamp.br> <ory7gtbkd9.fsf@oliva.athome.lsd.ic.unicamp.br> <20070806201102.GF4460@kam.mff.cuni.cz> <orprzw2kuk.fsf@free.oliva.athome.lsd.ic.unicamp.br>
On Oct 3, 2007, Alexandre Oliva <aoliva@redhat.com> wrote:
> However, it breaks the vta branch, because we still keep debug
> annotations for variables in blocks that your patch removes. I
> suppose I could just drop such annotations in the floor for now, but,
> in the long run, should I?
Rather than dropping the annotations, I can simply drop the block
information from them, as in the following patch, that I've just
installed in the vta branch, along with your patch.
for gcc/ChangeLog.vta
from Alexandre Oliva <aoliva@redhat.com>
* tree-ssa-live.c (copy_body_r): Cope with references to
removed blocks in debug stmts.
Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c.orig 2007-10-09 03:31:45.000000000 -0300
+++ gcc/tree-inline.c 2007-10-09 17:39:25.000000000 -0300
@@ -731,8 +731,12 @@ copy_body_r (tree *tp, int *walk_subtree
tree *n;
n = (tree *) pointer_map_contains (id->decl_map,
TREE_BLOCK (*tp));
- gcc_assert (n);
- new_block = *n;
+ if (n)
+ new_block = *n;
+ else if (IS_DEBUG_STMT (*tp) || processing_debug_stmt_p)
+ new_block = NULL;
+ else
+ gcc_unreachable ();
}
TREE_BLOCK (*tp) = new_block;
}
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}