re PR middle-end/71308 (ICE (segfault) in in gimple_fold_call gimple-fold.c:3060)

PR middle-end/71308
	* gimple-fold.c (gimple_fold_call): Check that LHS is not null.

	* g++.dg/torture/pr71308.C: New test.

From-SVN: r236815
This commit is contained in:
Marek Polacek 2016-05-27 12:08:03 +00:00 committed by Marek Polacek
parent 3168e073cb
commit 3cee7e4e2b
4 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2016-05-27 Marek Polacek <polacek@redhat.com>
PR middle-end/71308
* gimple-fold.c (gimple_fold_call): Check that LHS is not null.
2016-05-27 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.md (2x risbg splitters): Use

View File

@ -3053,7 +3053,8 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
== void_type_node))
gimple_call_set_fntype (stmt, TREE_TYPE (fndecl));
/* If the call becomes noreturn, remove the lhs. */
if (gimple_call_noreturn_p (stmt)
if (lhs
&& gimple_call_noreturn_p (stmt)
&& (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (stmt)))
|| should_remove_lhs_p (lhs)))
{

View File

@ -1,3 +1,8 @@
2016-05-27 Marek Polacek <polacek@redhat.com>
PR middle-end/71308
* g++.dg/torture/pr71308.C: New test.
2016-05-27 Dominik Vogt <vogt@linux.vnet.ibm.com>
* gcc.dg/zero_bits_compound-1.c: New test.

View File

@ -0,0 +1,18 @@
// PR middle-end/71308
// { dg-do compile }
class S
{
void foo ();
virtual void bar () = 0;
virtual ~S ();
};
inline void
S::foo ()
{
bar ();
};
S::~S ()
{
foo ();
}