aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2004-08-24 20:59:34 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2004-08-24 20:59:34 +0000
commit37840132447cb12a15699aab6fc34da9429426c5 (patch)
tree5b7454c7dee1a71674b5a33553de434a72cbb94e /gcc/tree-ssa-threadupdate.c
parentcf1d880b5f6314fce9ae12978a30efe450b1b6cf (diff)
downloadgcc-37840132447cb12a15699aab6fc34da9429426c5.zip
gcc-37840132447cb12a15699aab6fc34da9429426c5.tar.gz
gcc-37840132447cb12a15699aab6fc34da9429426c5.tar.bz2
re PR middle-end/17044 (libgcc2.c:169: internal compiler error: Segmentation fault)
PR middle-end/17044 * tree-ssa-threadupdate.c (redirection_data): Make static. (thread_block): Use ggc_alloc_cleared to allocate struct redirection_data. Don't free elements in redirection_data. From-SVN: r86519
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 37c8930..43b6b88 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -92,6 +92,9 @@ struct redirection_data
edge outgoing_edge;
};
+/* Main data structure to hold information for duplicates of BB. */
+static varray_type redirection_data;
+
/* For each PHI node in BB, find or create a PHI node in NEW_BB for the
same PHI_RESULT. Add an argument to the PHI node in NEW_BB which
corresponds to the same PHI argument associated with edge E in BB. */
@@ -239,8 +242,6 @@ thread_block (basic_block bb)
be threaded to a duplicate of BB. */
bool all = true;
- /* Main data structure to hold information for duplicates of BB. */
- varray_type redirection_data;
unsigned int i;
VARRAY_GENERIC_PTR_INIT (redirection_data, 2, "redirection data");
@@ -278,7 +279,7 @@ thread_block (basic_block bb)
{
struct redirection_data *rd;
- rd = xcalloc (1, sizeof (redirection_data));
+ rd = ggc_alloc_cleared (sizeof (struct redirection_data));
rd->outgoing_edge = e->aux;
VARRAY_PUSH_GENERIC_PTR (redirection_data, rd);
}
@@ -372,14 +373,7 @@ thread_block (basic_block bb)
remove_last_stmt_and_useless_edges (bb, rd->outgoing_edge->dest);
}
- /* Done with this block. Free any memory we have allocated, clear
- REDIRECTION_DATA and unmark this block as needing incoming
- edge redirections. */
- for (i = 0; i < VARRAY_ACTIVE_SIZE (redirection_data); i++)
- {
- struct redirection_data *rd = VARRAY_GENERIC_PTR (redirection_data, i);
- free (rd);
- }
+ /* Done with this block. Clear REDIRECTION_DATA. */
VARRAY_CLEAR (redirection_data);
}