aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-08-19 13:44:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-08-19 13:44:42 +0200
commite92cbe3a1df3f5ad7027d9863c5a49c34cf789e9 (patch)
tree23cc5f3b6e29a6efeeed823d7dcca1ea37695e1d /gcc/tree.c
parent53f3815cc08c390d2aee47a252203d416304298c (diff)
downloadgcc-e92cbe3a1df3f5ad7027d9863c5a49c34cf789e9.zip
gcc-e92cbe3a1df3f5ad7027d9863c5a49c34cf789e9.tar.gz
gcc-e92cbe3a1df3f5ad7027d9863c5a49c34cf789e9.tar.bz2
re PR debug/37156 (Hang with -g -O2 (or higher) (discovered with malloc.c in sqlite3))
PR debug/37156 * pretty-print.c (pp_base_format): Deal with recursive BLOCK trees. * tree.c (block_nonartificial_location): Likewise. * error.c (cp_print_error_function): Deal with recursive BLOCK trees. * gcc.dg/pr37156.c: New test. From-SVN: r139230
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 4441bc0..95d4d5e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8819,7 +8819,9 @@ block_nonartificial_location (tree block)
{
tree ao = BLOCK_ABSTRACT_ORIGIN (block);
- while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ while (TREE_CODE (ao) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (ao)
+ && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
ao = BLOCK_ABSTRACT_ORIGIN (ao);
if (TREE_CODE (ao) == FUNCTION_DECL)