diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-01-12 10:43:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-01-12 10:43:31 +0100 |
commit | 082ab5ff77937fc128fd802fde9d580ca76d71f1 (patch) | |
tree | cf837610df26a25fc371d690acc9bce414016e16 /gcc/tree-inline.c | |
parent | b1a54dd0523fe1104313b9d19897f24779dce5b7 (diff) | |
download | gcc-082ab5ff77937fc128fd802fde9d580ca76d71f1.zip gcc-082ab5ff77937fc128fd802fde9d580ca76d71f1.tar.gz gcc-082ab5ff77937fc128fd802fde9d580ca76d71f1.tar.bz2 |
re PR tree-optimization/42645 ("-fcompare-debug failure" at -O1)
PR tree-optimization/42645
* tree-inline.c (processing_debug_stmt): Move earlier. Make static.
(remap_ssa_name): If processing_debug_stmt and name wasn't found in
decl_map, set processing_debug_stmt to -1 and return name without
any remapping.
* g++.dg/other/pr42645-1.C: New test.
* g++.dg/other/pr42645-2.C: New test.
From-SVN: r155830
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index aacd903..883a431 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1,5 +1,5 @@ /* Tree inlining. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Alexandre Oliva <aoliva@redhat.com> @@ -171,6 +171,12 @@ insert_debug_decl_map (copy_body_data *id, tree key, tree value) *pointer_map_insert (id->debug_map, key) = value; } +/* If nonzero, we're remapping the contents of inlined debug + statements. If negative, an error has occurred, such as a + reference to a variable that isn't available in the inlined + context. */ +static int processing_debug_stmt = 0; + /* Construct new SSA name for old NAME. ID is the inline context. */ static tree @@ -185,6 +191,12 @@ remap_ssa_name (tree name, copy_body_data *id) if (n) return unshare_expr (*n); + if (processing_debug_stmt) + { + processing_debug_stmt = -1; + return name; + } + /* Do not set DEF_STMT yet as statement is not copied yet. We do that in copy_bb. */ new_tree = remap_decl (SSA_NAME_VAR (name), id); @@ -244,12 +256,6 @@ remap_ssa_name (tree name, copy_body_data *id) return new_tree; } -/* If nonzero, we're remapping the contents of inlined debug - statements. If negative, an error has occurred, such as a - reference to a variable that isn't available in the inlined - context. */ -int processing_debug_stmt = 0; - /* Remap DECL during the copying of the BLOCK tree for the function. */ tree |