Commit 47768df8 by Marek Polacek Committed by Marek Polacek

re PR ipa/71146 (error: __builtin_unreachable or __builtin_trap call with arguments)

	PR ipa/71146
	* tree-inline.c (expand_call_inline): Call
	maybe_remove_unused_call_args.

	* g++.dg/ipa/pr71146.C: New test.

From-SVN: r236343
parent 6b5423a5
2016-05-17 Marek Polacek <polacek@redhat.com>
PR ipa/71146
* tree-inline.c (expand_call_inline): Call
maybe_remove_unused_call_args.
2016-05-17 Jim Wilson <jim.wilson@linaro.org>
* doc/cpp.texi (__GNUC__): Major version changes are no longer rare.
......
2016-05-17 Marek Polacek <polacek@redhat.com>
PR ipa/71146
* g++.dg/ipa/pr71146.C: New test.
2016-05-17 David Malcolm <dmalcolm@redhat.com>
* jit.dg/test-error-array-bounds.c: New test case.
......
// PR ipa/71146
// { dg-do compile }
// { dg-options "-O3" }
typedef enum { X } E;
struct A {
virtual void bar ();
};
struct B {
virtual E fn (const char *, int, int *) = 0;
};
struct C : A, B {
E fn (const char *, int, int *);
void fn2 ();
B *foo;
};
void C::fn2 () {
if (!foo)
return;
foo->fn (0, 0, 0);
}
E
C::fn (const char *, int, int *)
{
fn2 ();
foo = 0;
fn (0, 0, 0);
return X;
}
......@@ -4486,6 +4486,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
update_stmt (stmt);
id->src_node->remove ();
expand_call_inline (bb, stmt, id);
maybe_remove_unused_call_args (cfun, stmt);
return true;
}
fn = cg_edge->callee->decl;
......
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