From: Richard Guenther Date: Sun, 13 Jul 2008 17:28:26 +0000 (+0000) Subject: re PR middle-end/36811 (endless (?) loop building with -O3) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4c91e0d876115fe3e6a04d88fc89235127a5390;p=gcc.git re PR middle-end/36811 (endless (?) loop building with -O3) 2008-07-13 Richard Guenther PR middle-end/36811 * langhooks.c (lhd_print_error_function): Deal with recursive BLOCK trees. From-SVN: r137754 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d38611b8fb2..7bc3702b329 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-07-13 Richard Guenther + + PR middle-end/36811 + * langhooks.c (lhd_print_error_function): Deal with recursive + BLOCK trees. + 2008-07-12 Jan Hubicka * cgraph.c (assembler_name_hash): New static var. 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)