From ea2c67849094ce801accf126a96e9148eaefe272 Mon Sep 17 00:00:00 2001 From: baldrick Date: Fri, 11 Dec 2009 14:38:55 +0000 Subject: [PATCH] IPA passes are bigger than other passes, so more memory needs to be allocated for them (and more copied) in make_pass_instance. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155161 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/passes.c | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24e65e1..cf0c2e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-12-11 Duncan Sands + + * passes.c (make_pass_instance): Allocate and copy the right amount of + memory for ipa passes, which are not the same size as other passes. + 2009-12-11 Joern Rennecke * plugin.c (get_named_event_id): Fix hash table rebuild to include diff --git a/gcc/passes.c b/gcc/passes.c index 818adde..a373a00 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -460,8 +460,21 @@ make_pass_instance (struct opt_pass *pass, bool track_duplicates) { struct opt_pass *new_pass; - new_pass = XNEW (struct opt_pass); - memcpy (new_pass, pass, sizeof (*new_pass)); + if (pass->type == GIMPLE_PASS + || pass->type == RTL_PASS + || pass->type == SIMPLE_IPA_PASS) + { + new_pass = XNEW (struct opt_pass); + memcpy (new_pass, pass, sizeof (struct opt_pass)); + } + else if (pass->type == IPA_PASS) + { + new_pass = (struct opt_pass *)XNEW (struct ipa_opt_pass_d); + memcpy (new_pass, pass, sizeof (struct ipa_opt_pass_d)); + } + else + gcc_unreachable (); + new_pass->next = NULL; new_pass->todo_flags_start &= ~TODO_mark_first_instance; -- 2.7.4