summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-29 21:34:33 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-29 21:34:33 +0000
commitaac7998f5bb590b6728bfcb433e3f73dc471311a (patch)
treea31c32203ff6d0e6114f2c5ebf7d2f5b3387aa4f
parent954ea6adb1acbcf8a3cac4f7c48a3cc73c8ce8ec (diff)
downloadppe42-gcc-aac7998f5bb590b6728bfcb433e3f73dc471311a.tar.gz
ppe42-gcc-aac7998f5bb590b6728bfcb433e3f73dc471311a.zip
PR middle-end/24109
* c-decl.c (c_write_global_declarations_1): If any wrapup_global_declaration_2 call returned true, restart the loop. * gcc.c-torture/execute/20050929-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104794 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-decl.c14
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20050929-1.c20
4 files changed, 43 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2242dcdf8cd..799488a696b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/24109
+ * c-decl.c (c_write_global_declarations_1): If any
+ wrapup_global_declaration_2 call returned true, restart the loop.
+
2005-09-29 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/24117
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 49c8904fc04..9c2e829b0c9 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -7548,6 +7548,7 @@ static void
c_write_global_declarations_1 (tree globals)
{
tree decl;
+ bool reconsider;
/* Process the decls in the order they were written. */
for (decl = globals; decl; decl = TREE_CHAIN (decl))
@@ -7566,9 +7567,18 @@ c_write_global_declarations_1 (tree globals)
}
wrapup_global_declaration_1 (decl);
- wrapup_global_declaration_2 (decl);
- check_global_declaration_1 (decl);
}
+
+ do
+ {
+ reconsider = false;
+ for (decl = globals; decl; decl = TREE_CHAIN (decl))
+ reconsider |= wrapup_global_declaration_2 (decl);
+ }
+ while (reconsider);
+
+ for (decl = globals; decl; decl = TREE_CHAIN (decl))
+ check_global_declaration_1 (decl);
}
/* A subroutine of c_write_global_declarations Emit debug information for each
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f916b76c2fd..d595aa3f2f9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/24109
+ * gcc.c-torture/execute/20050929-1.c: New test.
+
2005-09-29 Steven Bosscher <stevenb@suse.de>
* gcc.dg/tree-ssa/ssa-ccp-11.c: Fix the test case and un-xfail.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050929-1.c b/gcc/testsuite/gcc.c-torture/execute/20050929-1.c
new file mode 100644
index 00000000000..7be2eb813f7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20050929-1.c
@@ -0,0 +1,20 @@
+/* PR middle-end/24109 */
+
+extern void abort (void);
+
+struct A { int i; int j; };
+struct B { struct A *a; struct A *b; };
+struct C { struct B *c; struct A *d; };
+struct C e = { &(struct B) { &(struct A) { 1, 2 }, &(struct A) { 3, 4 } }, &(struct A) { 5, 6 } };
+
+int
+main (void)
+{
+ if (e.c->a->i != 1 || e.c->a->j != 2)
+ abort ();
+ if (e.c->b->i != 3 || e.c->b->j != 4)
+ abort ();
+ if (e.d->i != 5 || e.d->j != 6)
+ abort ();
+ return 0;
+}
OpenPOWER on IntegriCloud