diff options
author | Markus Trippelsdorf <markus@trippelsdorf.de> | 2014-09-19 14:44:09 +0000 |
---|---|---|
committer | Markus Trippelsdorf <trippels@gcc.gnu.org> | 2014-09-19 14:44:09 +0000 |
commit | 4cd5658b606e4a72cdc64387e5b6bf808ba5d81d (patch) | |
tree | 8187b8113b0dd373ea44265c8afdac049cbe039a /gcc/ipa-devirt.c | |
parent | 5fd4bc96306dccae16acb28c38ab63f213555c04 (diff) | |
download | gcc-4cd5658b606e4a72cdc64387e5b6bf808ba5d81d.zip gcc-4cd5658b606e4a72cdc64387e5b6bf808ba5d81d.tar.gz gcc-4cd5658b606e4a72cdc64387e5b6bf808ba5d81d.tar.bz2 |
PR ipa/61998 Fix crash -Wsuggest-final-types crash
-Wsuggest-final-types crashes when used on mininal testcases.
Fix by bailing out early when odr_types_ptr is NULL in ipa_devirt()
2014-09-19 Markus Trippelsdorf <markus@trippelsdorf.de>
PR ipa/61998
* ipa-devirt.c (ipa_devirt): Bail out if odr_types_ptr is NULL.
2014-09-19 Markus Trippelsdorf <markus@trippelsdorf.de>
PR ipa/61998
* g++.dg/warn/Wsuggest-final-2.C: New testcase.
From-SVN: r215392
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 0a11eb7..61e87e8 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -3952,6 +3952,9 @@ ipa_devirt (void) int nmultiple = 0, noverwritable = 0, ndevirtualized = 0, nnotdefined = 0; int nwrong = 0, nok = 0, nexternal = 0, nartificial = 0; + if (!odr_types_ptr) + return 0; + /* We can output -Wsuggest-final-methods and -Wsuggest-final-types warnings. This is implemented by setting up final_warning_records that are updated by get_polymorphic_call_targets. |