This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix cgraph_edge::redirect_call_stmt_to_callee noreturn call handling (PR c++/78692)


On 12/07/2016 10:28 AM, Jakub Jelinek wrote:
Hi!

The code in this function assumes that lhs is the lhs of new_stmt (it tests
that new_stmt is a noreturn call etc.), but that is only the case if
new_stmt == e->call_stmt.  But in the function it can be set to various
other stmts.  Nothing tests the lhs before this noreturn handling, so this
patch fixes it by moving the initialization of lhs right before the use.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-12-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/78692
	* cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Set lhs
	var to lhs of new_stmt right before noreturn handling rather than to
	lhs of e->call_stmt early.

	* g++.dg/torture/pr78692.C: New test.
OK.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]