diff options
author | Basile Starynkevitch <basile@starynkevitch.net> | 2009-10-13 14:58:11 +0000 |
---|---|---|
committer | Basile Starynkevitch <bstarynk@gcc.gnu.org> | 2009-10-13 14:58:11 +0000 |
commit | b9e467a24acb203f5a087721a74943a3af67f16a (patch) | |
tree | 65b28e352bda503a353f6ef20fab063733eeb5f2 /gcc | |
parent | a018595e87017b5f77a791b20dadf45e7cb25e58 (diff) | |
download | gcc-b9e467a24acb203f5a087721a74943a3af67f16a.zip gcc-b9e467a24acb203f5a087721a74943a3af67f16a.tar.gz gcc-b9e467a24acb203f5a087721a74943a3af67f16a.tar.bz2 |
passes.c (register_pass): Replaced gcc_unreachable by fatal_error on failure.
2009-10-13 Basile Starynkevitch <basile@starynkevitch.net>
* gcc/passes.c (register_pass): Replaced gcc_unreachable by
fatal_error on failure. Mentions plugins in comments & messages.
From-SVN: r152709
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/passes.c | 25 |
2 files changed, 21 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5556683..e2a71f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ + +2009-10-13 Basile Starynkevitch <basile@starynkevitch.net> + * passes.c (register_pass): Replaced gcc_unreachable by + fatal_error on failure. Mentions plugins in comments & messages. + 2009-10-13 Jakub Jelinek <jakub@redhat.com> PR target/41693 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 |