re PR middle-end/65555 (ICE: verify_gimple failed (LHS in noreturn call))

2015-03-26  Richard Biener  <rguenther@suse.de>

	PR middle-end/65555
	* tree-cfg.c (verify_gimple_call): Do not require a call to
	have no LHS if it wasn't recognized as control altering yet.

	* g++.dg/torture/pr65555.C: New testcase.

From-SVN: r221697
This commit is contained in:
Richard Biener 2015-03-26 14:22:57 +00:00 committed by Richard Biener
parent 672ff0b6fd
commit fd0c2f00f6
4 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2015-03-26 Richard Biener <rguenther@suse.de>
PR middle-end/65555
* tree-cfg.c (verify_gimple_call): Do not require a call to
have no LHS if it wasn't recognized as control altering yet.
2015-03-26 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/64715

View file

@ -1,3 +1,8 @@
2015-03-26 Richard Biener <rguenther@suse.de>
PR middle-end/65555
* g++.dg/torture/pr65555.C: New testcase.
2015-03-26 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/64715

View file

@ -0,0 +1,11 @@
// { dg-do compile }
class basic_ostream {
public:
basic_ostream &operator<<(basic_ostream &p1(basic_ostream &)) {
return p1(*this);
}
} a;
void fn1() __attribute__((__noreturn__));
basic_ostream &fn2(basic_ostream &) { fn1(); }
void fn3() { a << fn2; }

View file

@ -3335,7 +3335,9 @@ verify_gimple_call (gcall *stmt)
return true;
}
if (gimple_call_lhs (stmt) && gimple_call_noreturn_p (stmt))
if (gimple_call_ctrl_altering_p (stmt)
&& gimple_call_lhs (stmt)
&& gimple_call_noreturn_p (stmt))
{
error ("LHS in noreturn call");
return true;