From: Andi Kleen Date: Thu, 25 Jul 2024 20:54:50 +0000 (-0700) Subject: PR116019: Improve tail call error message X-Git-Tag: basepoints/gcc-16~7213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=899ee4815424a73a2b9d899591fab3fcc4520b61;p=thirdparty%2Fgcc.git PR116019: Improve tail call error message The "tail call must be the same type" message is common on some targets with C++, or without optimization. It is generated when gcc believes there is an access of the return value after the call. However usually it does not actually corespond to a type mismatch, but can be caused for other reasons. Make it slightly more vague to be less misleading. gcc/ChangeLog: PR c++/116019 * tree-tailcall.cc (find_tail_calls): Change tail call error message. --- diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc index a68079d4f50..1901b1a13f9 100644 --- a/gcc/tree-tailcall.cc +++ b/gcc/tree-tailcall.cc @@ -632,7 +632,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail, && may_be_aliased (result_decl) && ref_maybe_used_by_stmt_p (call, result_decl, false)) { - maybe_error_musttail (call, _("tail call must be same type")); + maybe_error_musttail (call, _("return value used after call")); return; }