From b9e467a24acb203f5a087721a74943a3af67f16a Mon Sep 17 00:00:00 2001 From: Basile Starynkevitch Date: Tue, 13 Oct 2009 14:58:11 +0000 Subject: passes.c (register_pass): Replaced gcc_unreachable by fatal_error on failure. 2009-10-13 Basile Starynkevitch * gcc/passes.c (register_pass): Replaced gcc_unreachable by fatal_error on failure. Mentions plugins in comments & messages. From-SVN: r152709 --- gcc/passes.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'gcc/passes.c') diff --git a/gcc/passes.c b/gcc/passes.c index 5ed1206..5a47215 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -600,24 +600,31 @@ position_pass (struct register_pass_info *new_pass_info, void register_pass (struct register_pass_info *pass_info) { + /* The checks below could fail in buggy plugins. Existing GCC + passes should never fail these checks, so we mention plugin in + the messages. */ if (!pass_info->pass) - { - gcc_unreachable (); - } + fatal_error ("plugin cannot register a missing pass"); + + if (!pass_info->pass->name) + fatal_error ("plugin cannot register an unnamed pass"); if (!pass_info->reference_pass_name) - { - gcc_unreachable (); - } + fatal_error + ("plugin cannot register pass %qs without reference pass name", + 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 them. */ + /* 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 + 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)) - gcc_unreachable (); + 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 -- cgit v1.1