diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2012-12-16 17:34:58 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2012-12-16 17:34:58 +0000 |
commit | 6180209821b0ea49ecc060d5657e876c93ff12a5 (patch) | |
tree | 8ca040f2f18e62eaa90b69da9d175142cbab6232 /gcc | |
parent | df0b360e3e82962e7b5e805c130a38593b646a80 (diff) | |
download | gcc-6180209821b0ea49ecc060d5657e876c93ff12a5.zip gcc-6180209821b0ea49ecc060d5657e876c93ff12a5.tar.gz gcc-6180209821b0ea49ecc060d5657e876c93ff12a5.tar.bz2 |
re PR middle-end/55709 (Infinite loop in pointer_set_insert compiling cp/pt.c)
PR middle-end/55709
Forward port from 4.7 branch:
2012-04-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR middle-end/52894
* varasm.c (process_pending_assemble_externals): Set
pending_assemble_externals_processed true.
(assemble_external): Call assemble_external_real if the pending
assemble externals have been processed.
From-SVN: r194538
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/varasm.c | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3583ed..a64aaec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2012-12-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR middle-end/55709 + Forward port from 4.7 branch: + 2012-04-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR middle-end/52894 + * varasm.c (process_pending_assemble_externals): Set + pending_assemble_externals_processed true. + (assemble_external): Call assemble_external_real if the pending + assemble externals have been processed. + 2012-12-16 Eric Botcazou <ebotcazou@adacore.com> Tomash Brechko <tomash.brechko@gmail.com> diff --git a/gcc/varasm.c b/gcc/varasm.c index bca852d..daeb6e2 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2088,6 +2088,11 @@ contains_pointers_p (tree type) it all the way to final. See PR 17982 for further discussion. */ static GTY(()) tree pending_assemble_externals; +/* Some targets delay some output to final using TARGET_ASM_FILE_END. + As a result, assemble_external can be called after the list of externals + is processed and the pointer set destroyed. */ +static bool pending_assemble_externals_processed; + #ifdef ASM_OUTPUT_EXTERNAL /* Avoid O(external_decls**2) lookups in the pending_assemble_externals TREE_LIST in assemble_external. */ @@ -2144,6 +2149,7 @@ process_pending_assemble_externals (void) assemble_external_real (TREE_VALUE (list)); pending_assemble_externals = 0; + pending_assemble_externals_processed = true; pointer_set_destroy (pending_assemble_externals_set); #endif } @@ -2196,6 +2202,12 @@ assemble_external (tree decl ATTRIBUTE_UNUSED) weak_decls = tree_cons (NULL, decl, weak_decls); #ifdef ASM_OUTPUT_EXTERNAL + if (pending_assemble_externals_processed) + { + assemble_external_real (decl); + return; + } + if (! pointer_set_insert (pending_assemble_externals_set, decl)) pending_assemble_externals = tree_cons (NULL, decl, pending_assemble_externals); |