From: Jan Hubicka Date: Sat, 27 Sep 2014 00:19:06 +0000 (+0200) Subject: re PR ipa/62121 (ICE: Segmentation fault in ipa-devirt.c:997) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec1d732bc6e08ede9c33029347d0568ca310531f;p=gcc.git re PR ipa/62121 (ICE: Segmentation fault in ipa-devirt.c:997) PR ipa/62121 * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_class): fix pasto in checking array size. * g++.dg/torture/pr62121.C: New testcase. From-SVN: r215655 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3a62f5f82b..203e1f53e07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-26 Jan Hubicka + + PR ipa/62121 + * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_class): + fix pasto in checking array size. + 2014-09-26 Jan Hubicka PR middle-end/35545 diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index 23f14ac60e3..e682b2b45dd 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -327,7 +327,7 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree expected_type) && (cur_offset + (expected_type ? tree_to_uhwi (TYPE_SIZE (expected_type)) : 0) - > tree_to_uhwi (TYPE_SIZE (type)))) + > tree_to_uhwi (TYPE_SIZE (subtype)))) goto no_useful_type_info; cur_offset = new_offset; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd76fa5fbe3..e3396c54a81 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-26 Jan Hubicka + + PR ipa/62121 + * g++.dg/torture/pr62121.C: New testcase. + 2014-09-26 Jan Hubicka PR middle-end/35545 diff --git a/gcc/testsuite/g++.dg/torture/pr62121.C b/gcc/testsuite/g++.dg/torture/pr62121.C new file mode 100644 index 00000000000..de1196a62e1 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr62121.C @@ -0,0 +1,12 @@ +// { dg-do compile } +class A +{ + virtual double operator()(); +}; +class B : A +{ +public: + double operator()(); +}; +extern B a[]; +int b = a[0]();