Commit 669887fc by Duncan Sands Committed by Duncan Sands

If a pass occurs in several pass lists...

If a pass occurs in several pass lists, like pass_cleanup_eh which occurs in
both all_small_ipa_passes and all_passes, make sure all instances of it are
considered for replacement/insertion when ref_pass_instance_number is zero,
not just the instance in the first pass list.

From-SVN: r156961
parent 9efc83f4
2010-02-22 Duncan Sands <baldrick@free.fr>
* passes.c (register_pass): Always consider all pass lists when
ref_pass_instance_number is zero.
2010-02-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42749
......
......@@ -632,6 +632,8 @@ position_pass (struct register_pass_info *new_pass_info,
void
register_pass (struct register_pass_info *pass_info)
{
bool all_instances, success;
/* The checks below could fail in buggy plugins. Existing GCC
passes should never fail these checks, so we mention plugin in
the messages. */
......@@ -647,18 +649,23 @@ register_pass (struct register_pass_info *pass_info)
pass_info->pass->name);
/* Try to insert the new pass to the pass lists. We need to check
all three lists as the reference pass could be in one (or all) of
all five lists as the reference pass could be in one (or all) of
them. */
if (!position_pass (pass_info, &all_lowering_passes)
&& !position_pass (pass_info, &all_small_ipa_passes)
&& !position_pass (pass_info, &all_regular_ipa_passes)
&& !position_pass (pass_info, &all_lto_gen_passes)
&& !position_pass (pass_info, &all_passes))
all_instances = pass_info->ref_pass_instance_number == 0;
success = position_pass (pass_info, &all_lowering_passes);
if (!success || all_instances)
success |= position_pass (pass_info, &all_small_ipa_passes);
if (!success || all_instances)
success |= position_pass (pass_info, &all_regular_ipa_passes);
if (!success || all_instances)
success |= position_pass (pass_info, &all_lto_gen_passes);
if (!success || all_instances)
success |= position_pass (pass_info, &all_passes);
if (!success)
fatal_error
("pass %qs not found but is referenced by new pass %qs",
pass_info->reference_pass_name, pass_info->pass->name);
else
{
/* OK, we have successfully inserted the new pass. We need to register
the dump files for the newly added pass and its duplicates (if any).
Because the registration of plugin/backend passes happens after the
......@@ -687,7 +694,6 @@ register_pass (struct register_pass_info *pass_info)
XDELETE (added_pass_nodes);
added_pass_nodes = next_node;
}
}
}
/* Construct the pass tree. The sequencing of passes is driven by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment