This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[vta] don't mark vars as referenced in inline-remapped debug stmts
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 06 Mar 2009 05:55:21 -0300
- Subject: [vta] don't mark vars as referenced in inline-remapped debug stmts
Debug stmts may remain for variables otherwise removed. Marking such
variables as referenced causes their var_ann to be required at some
places, but variables that are only used in debug stmts won't have them.
In fact, variables only used in debug stmts are not supposed to be
regarded as referenced. This patch fixes the gimple_op remapper to not
mark variables while processing debug stmts.
I'm installing this in the branch.
for gcc/ChangeLog.vta
from Alexandre Oliva <aoliva@redhat.com>
* tree-inline.c (remap_gimple_op_r): Don't mark variable in
debug stmt as referenced.
Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c.orig 2009-03-04 05:12:04.000000000 -0300
+++ gcc/tree-inline.c 2009-03-05 03:52:12.000000000 -0300
@@ -1,5 +1,5 @@
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
@@ -762,7 +762,8 @@ remap_gimple_op_r (tree *tp, int *walk_s
vars. If not referenced from types only. */
if (gimple_in_ssa_p (cfun)
&& TREE_CODE (*tp) == VAR_DECL
- && id->remapping_type_depth == 0)
+ && id->remapping_type_depth == 0
+ && !processing_debug_stmt)
add_referenced_var (*tp);
/* We should never have TREE_BLOCK set on non-statements. */
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer