summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-26 14:22:57 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-26 14:22:57 +0000
commit649cf3c4dfd793d5a3529c4747840b90542d59ff (patch)
tree6e74ed7d51be067c301cab1a32ed1e0144bfe1f3
parentece434d41d753a85d543d2ada95dd2f77310a7e7 (diff)
downloadgcc-649cf3c4dfd793d5a3529c4747840b90542d59ff.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221697 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr65555.C11
-rw-r--r--gcc/tree-cfg.c4
4 files changed, 25 insertions, 1 deletions
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 <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
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 <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
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;