From: Markus Trippelsdorf Date: Tue, 25 Nov 2014 07:41:48 +0000 (+0000) Subject: re PR ipa/64059 (ICE: Segmentation fault in ipa-polymorphic-call.c:1593) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5b58b283d4f139da5cca26af936ddb65dd4ad7c;p=gcc.git re PR ipa/64059 (ICE: Segmentation fault in ipa-polymorphic-call.c:1593) Fix PR64059 * ipa-prop.c (ipa_analyze_call_uses): Don't call get_dynamic_type when devirtualization is disabled. From-SVN: r218038 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5db7497608b..8ff9c72256d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-25 Jan Hubicka + + PR ipa/64059 + * ipa-prop.c (ipa_analyze_call_uses): Don't call get_dynamic_type when + devirtualization is disabled. + 2014-11-24 Michael Meissner PR target/63965 diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 2e0016bfbe6..eeffda449d9 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2155,7 +2155,7 @@ ipa_analyze_call_uses (struct func_body_info *fbi, gcall *call) if (cs && !cs->indirect_unknown_callee) return; - if (cs->indirect_info->polymorphic) + if (cs->indirect_info->polymorphic && flag_devirtualize) { tree instance; tree target = gimple_call_fn (call); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cee2f3d15b7..147674e67ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-25 Markus Trippelsdorf + + PR ipa/64059 + * g++.dg/ipa/pr64059.C: New test. + 2014-11-24 Uros Bizjak PR target/63847 diff --git a/gcc/testsuite/g++.dg/ipa/pr64059.C b/gcc/testsuite/g++.dg/ipa/pr64059.C new file mode 100644 index 00000000000..0269b45458d --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr64059.C @@ -0,0 +1,56 @@ +// { dg-options "-r -nostdlib -O2 -flto -fno-devirtualize" } +// { dg-require-effective-target lto } + +class A; +class B +{ +public: + A *operator->(); +}; +class C +{ +public: + virtual void m_fn1 (); +}; +class A +{ +public: + C *m_fn2 (); +}; +class D +{ +public: + void + m_fn3 () + { + list_m->m_fn2 ()->m_fn1 (); + } + B list_m; +}; + +class F +{ +public: + D m_fn4 (); +}; +class G +{ +public: + F m_fn5 (int, int); +}; +class H +{ +public: + void + m_fn6 () + { + fieldEngine_m.m_fn5 (0, 0).m_fn4 ().m_fn3 (); + } + G fieldEngine_m; +}; + +void +fn1 (H a) +{ + a.m_fn6 (); +}