diff mbox series

[v1,2/2] PR116019: Improve tail call error message

Message ID 20240725225502.1550809-2-ak@linux.intel.com
State New
Headers show
Series [v1,1/2] PR116080: Fix tail call dejagnu checks | expand

Commit Message

Andi Kleen July 25, 2024, 10:55 p.m. UTC
From: Andi Kleen <ak@gcc.gnu.org>

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.
---
 gcc/tree-tailcall.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Biener July 26, 2024, 11:33 a.m. UTC | #1
On Fri, Jul 26, 2024 at 12:55 AM Andi Kleen <ak@linux.intel.com> wrote:
>
> From: Andi Kleen <ak@gcc.gnu.org>
>
> 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.

OK.

> gcc/ChangeLog:
>
>         PR c++/116019
>         * tree-tailcall.cc (find_tail_calls): Change tail call
>         error message.
> ---
>  gcc/tree-tailcall.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc
> index a68079d4f507..1901b1a13f99 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;
>      }
>
> --
> 2.45.2
>
diff mbox series

Patch

diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc
index a68079d4f507..1901b1a13f99 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;
     }