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
This commit is contained in:
Jan Hubicka 2014-09-27 02:19:06 +02:00 committed by Jan Hubicka
parent ee5bd6c8fd
commit ec1d732bc6
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-09-26 Jan Hubicka <hubicka@ucw.cz>
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 <hubicka@ucw.cz>
PR middle-end/35545

View File

@ -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;

View File

@ -1,3 +1,8 @@
2014-09-26 Jan Hubicka <hubicka@ucw.cz>
PR ipa/62121
* g++.dg/torture/pr62121.C: New testcase.
2014-09-26 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/35545

View File

@ -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]();