Commit e92cbe3a by Jakub Jelinek Committed by Jakub Jelinek

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
parent 53f3815c
2008-08-19 Jakub Jelinek <jakub@redhat.com>
PR debug/37156
* pretty-print.c (pp_base_format): Deal with recursive BLOCK trees.
* tree.c (block_nonartificial_location): Likewise.
2008-08-19 Richard Guenther <rguenther@suse.de> 2008-08-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35972 PR tree-optimization/35972
......
2008-08-19 Jakub Jelinek <jakub@redhat.com>
PR debug/37156
* error.c (cp_print_error_function): Deal with recursive BLOCK trees.
2008-08-18 Tomas Bily <tbily@suse.cz> 2008-08-18 Tomas Bily <tbily@suse.cz>
* tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P. * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
......
...@@ -2388,7 +2388,9 @@ cp_print_error_function (diagnostic_context *context, ...@@ -2388,7 +2388,9 @@ cp_print_error_function (diagnostic_context *context,
if (abstract_origin) if (abstract_origin)
{ {
ao = BLOCK_ABSTRACT_ORIGIN (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); ao = BLOCK_ABSTRACT_ORIGIN (ao);
gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); gcc_assert (TREE_CODE (ao) == FUNCTION_DECL);
fndecl = ao; fndecl = ao;
......
...@@ -501,7 +501,9 @@ pp_base_format (pretty_printer *pp, text_info *text) ...@@ -501,7 +501,9 @@ pp_base_format (pretty_printer *pp, text_info *text)
{ {
tree ao = BLOCK_ABSTRACT_ORIGIN (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); ao = BLOCK_ABSTRACT_ORIGIN (ao);
if (TREE_CODE (ao) == FUNCTION_DECL) if (TREE_CODE (ao) == FUNCTION_DECL)
......
2008-08-19 Jakub Jelinek <jakub@redhat.com>
PR debug/37156
* gcc.dg/pr37156.c: New test.
2008-08-19 Richard Guenther <rguenther@suse.de> 2008-08-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35972 PR tree-optimization/35972
......
/* PR debug/37156 */
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
__attribute__ ((warning ("is experimental"))) int bar (int, int *, int *, int);
long long foo (void)
{
int n, m;
long long r;
bar (0, &n, &m, 0); /* { dg-warning "is experimental" } */
r = (long long) n;
return r;
}
void
baz (int n)
{
int o;
o = foo () - n;
}
...@@ -8819,7 +8819,9 @@ block_nonartificial_location (tree block) ...@@ -8819,7 +8819,9 @@ block_nonartificial_location (tree block)
{ {
tree ao = BLOCK_ABSTRACT_ORIGIN (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); ao = BLOCK_ABSTRACT_ORIGIN (ao);
if (TREE_CODE (ao) == FUNCTION_DECL) if (TREE_CODE (ao) == FUNCTION_DECL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment