aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/pretty-print.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr37156.c21
-rw-r--r--gcc/tree.c4
7 files changed, 46 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1264aeef572..80a0a87c6fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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-18 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* real.c (spu_single_format): New variable.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4634bd01435..0ff8fdb880b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37156
+ * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
+
2008-08-07 Simon Baldwin <simonb@google.com>
Backport from mainline:
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 92924ff3319..2aa9d4c7b56 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2421,7 +2421,9 @@ cp_print_error_function (diagnostic_context *context,
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;
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index c4de15dc21a..92c37f86cc7 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -501,7 +501,9 @@ pp_base_format (pretty_printer *pp, text_info *text)
{
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)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 35666d58b98..1d8a0750f45 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37156
+ * gcc.dg/pr37156.c: New test.
+
2008-08-18 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gcc.c-torture/execute/ieee/inf-2.c (testf): Skip on the SPU.
diff --git a/gcc/testsuite/gcc.dg/pr37156.c b/gcc/testsuite/gcc.dg/pr37156.c
new file mode 100644
index 00000000000..e86f5950f73
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr37156.c
@@ -0,0 +1,21 @@
+/* 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;
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index 1a51f7f6ca6..422c7042ebd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8818,7 +8818,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)