From fd0c2f00f6b8adde3706d210d6de7a6e4b8f0ccc Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 26 Mar 2015 14:22:57 +0000 Subject: [PATCH] re PR middle-end/65555 (ICE: verify_gimple failed (LHS in noreturn call)) 2015-03-26 Richard Biener 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 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/torture/pr65555.C | 11 +++++++++++ gcc/tree-cfg.c | 4 +++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr65555.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a1a43fa285..f9ea6a0891f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-26 Richard Biener + + 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 PR tree-optimization/64715 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0fb7634d51..226ac2ac18c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-26 Richard Biener + + PR middle-end/65555 + * g++.dg/torture/pr65555.C: New testcase. + 2015-03-26 Jakub Jelinek PR tree-optimization/64715 diff --git a/gcc/testsuite/g++.dg/torture/pr65555.C b/gcc/testsuite/g++.dg/torture/pr65555.C new file mode 100644 index 00000000000..9027c69567d --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr65555.C @@ -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; } diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 98d6ba448fa..64bdc92e681 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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; -- 2.30.2