diff options
author | Richard Guenther <rguenther@suse.de> | 2008-07-13 17:28:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-07-13 17:28:26 +0000 |
commit | f4c91e0d876115fe3e6a04d88fc89235127a5390 (patch) | |
tree | 47829a64c961bcc1f71eab99a309a353024daf47 /gcc/langhooks.c | |
parent | 266ad5c82612749d080ab25f67a677c89b344567 (diff) | |
download | gcc-f4c91e0d876115fe3e6a04d88fc89235127a5390.tar.gz |
re PR middle-end/36811 (endless (?) loop building with -O3)
2008-07-13 Richard Guenther <rguenther@suse.de>
PR middle-end/36811
* langhooks.c (lhd_print_error_function): Deal with recursive
BLOCK trees.
From-SVN: r137754
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r-- | gcc/langhooks.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 3943f02b794..e2460473f54 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -394,7 +394,9 @@ lhd_print_error_function (diagnostic_context *context, const char *file, if (abstract_origin) { ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin); - 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); gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); fndecl = ao; @@ -424,7 +426,9 @@ lhd_print_error_function (diagnostic_context *context, const char *file, { 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) |