diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-05 15:35:13 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-05 15:35:13 +0000 |
commit | f63d3ecc34e8b969b3c940f14e725815c1ef3215 (patch) | |
tree | 12a9da39bc6bfc83111af358d8b58d60dbbd2f22 /gcc/tree.c | |
parent | 454f25be4550106b133980287ac7da30d2767f92 (diff) | |
download | gcc-f63d3ecc34e8b969b3c940f14e725815c1ef3215.tar.gz |
PR middle-end/40340
* tree-ssa-live.c (remove_unused_scope_block_p): Don't prune
inlined_function_outer_scope_p blocks for artificial inlines
even at -g0/-g1.
* tree.c (tree_nonartificial_location): Rewrite using
block_nonartificial_location.
* gcc.dg/pr40340-1.c: New test.
* gcc.dg/pr40340-2.c: New test.
* gcc.dg/pr40340-3.c: New test.
* gcc.dg/pr40340-4.c: New test.
* gcc.dg/pr40340-5.c: New test.
* gcc.dg/pr40340.h: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148212 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 5e562a59e05..352c5534348 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -9224,32 +9224,12 @@ block_nonartificial_location (tree block) location_t tree_nonartificial_location (tree exp) { - tree block = TREE_BLOCK (exp); + location_t *loc = block_nonartificial_location (TREE_BLOCK (exp)); - while (block - && TREE_CODE (block) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (block)) - { - tree ao = BLOCK_ABSTRACT_ORIGIN (block); - - do - { - if (TREE_CODE (ao) == FUNCTION_DECL - && DECL_DECLARED_INLINE_P (ao) - && lookup_attribute ("artificial", DECL_ATTRIBUTES (ao))) - return BLOCK_SOURCE_LOCATION (block); - else if (TREE_CODE (ao) == BLOCK - && BLOCK_SUPERCONTEXT (ao) != ao) - ao = BLOCK_SUPERCONTEXT (ao); - else - break; - } - while (ao); - - block = BLOCK_SUPERCONTEXT (block); - } - - return EXPR_LOCATION (exp); + if (loc) + return *loc; + else + return EXPR_LOCATION (exp); } |