Commit 6ba856d4 by Richard Biener Committed by Richard Biener

re PR ipa/81007 (ICE with virtual function in broken class)

2017-06-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/81007
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::restrict_to_inner_class):
	Skip FIELD_DECLs with error_mark_node type.
	* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
	last again.

	* g++.dg/pr81007.C: New testcase.

From-SVN: r249051
parent 903c723b
2017-06-09 Richard Biener <rguenther@suse.de>
PR middle-end/81007
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::restrict_to_inner_class):
Skip FIELD_DECLs with error_mark_node type.
* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
last again.
2017-06-09 Martin Liska <mliska@suse.cz>
* predict.c (struct branch_predictor): New struct.
......
......@@ -267,7 +267,8 @@ ipa_polymorphic_call_context::restrict_to_inner_class (tree otr_type,
{
for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))
{
if (TREE_CODE (fld) != FIELD_DECL)
if (TREE_CODE (fld) != FIELD_DECL
|| TREE_TYPE (fld) == error_mark_node)
continue;
pos = int_bit_position (fld);
......
......@@ -42,9 +42,9 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_build_cfg);
NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_expand_omp);
NEXT_PASS (pass_build_cgraph_edges);
NEXT_PASS (pass_sprintf_length, false);
NEXT_PASS (pass_walloca, /*strict_mode_p=*/true);
NEXT_PASS (pass_build_cgraph_edges);
TERMINATE_PASS_LIST (all_lowering_passes)
/* Interprocedural optimization passes. */
......
2017-06-09 Richard Biener <rguenther@suse.de>
PR middle-end/81007
* g++.dg/pr81007.C: New testcase.
2017-06-09 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
......
// { dg-do compile }
// { dg-options "-O2" }
struct A
{
A p; // { dg-error "incomplete" }
virtual void foo();
};
struct B : A {};
void bar(B& b)
{
b.foo();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment