From patchwork Sat Jun 22 18:54:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1951120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=M1mH+Nh5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W63Qs1hYLz1ydW for ; Sun, 23 Jun 2024 04:58:29 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E656385E003 for ; Sat, 22 Jun 2024 18:58:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by sourceware.org (Postfix) with ESMTPS id 043BF385DDC0 for ; Sat, 22 Jun 2024 18:56:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 043BF385DDC0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 043BF385DDC0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.17 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719082597; cv=none; b=qbvDxtPnSYMI30ZfriaX74vxSVYvns2Xi0Vc+v0UoHIf7Rj1KmAlxDofhMNM4S8RT/fBHUfgTRqTRo/AUmMWadijc7OAmF/1eb1mlsG2cqOSX4OCvM673ARwxPExpCtqWm8Qs2glNatEnwidBsZtPFeR6WJacQ6eoHZCwNQhjmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719082597; c=relaxed/simple; bh=BYoc+sMDJXND2J4/MVfJQ7hSwM3zjbToRKynf4bPKzI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=phNYAzPUoH3sIo0CNCFgo5ooqgoqHaE8alor+wthR8YJtYD540osB2D9En9KVyh7R3GLo4fJKmDvvxkb3M4mUBdKOA+/O0Wbt/jyoZKIcYj6o9bqb4r8Ym620Kzl1IU4KsJBlisRvIO6IZ8AAEJq4q4JxJpceuiV6JoKHpKclvE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719082592; x=1750618592; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BYoc+sMDJXND2J4/MVfJQ7hSwM3zjbToRKynf4bPKzI=; b=M1mH+Nh55DHn5S+8EZLN3QdWE/4B7YCryxeA2Ris5Z4i/l/tHBnIJU3V V4v8tnlQig1KekFKP9jcH3/mDa50YVhTyel9ipPG8KzFJ/zMng9NtfXiR Zl0OcqjxFfwNVotp5vPMbi+Av7w+FBAl+enH+fjc86Gh8no3Mf3K0jqOY nDHu1Qmk5AnaaImn9mqkEr7qfUvJszfKXADSAc0oJ2xe6jAMIILDWlhrB dOFFDz5ebIAxZ454jeRn+w63VcuVBde8QZoYDZt4ZIETs00+HFCj0pnJC 2GpduijUU6ClCJ70PfZXFqW3cbYpaUuTYQTMVTjfFcvlaKzEOSYfQHe8I g==; X-CSE-ConnectionGUID: +E6nWbXpRkKGXQKiCjGXIA== X-CSE-MsgGUID: ZkPTvH/BTbWclcThNDSXSw== X-IronPort-AV: E=McAfee;i="6700,10204,11111"; a="16216448" X-IronPort-AV: E=Sophos;i="6.08,258,1712646000"; d="scan'208";a="16216448" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2024 11:56:06 -0700 X-CSE-ConnectionGUID: 2Sss40FGTkeFizY2ZBB3cQ== X-CSE-MsgGUID: snRcdRINR3aoAb97bguLWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,258,1712646000"; d="scan'208";a="42968343" Received: from tassilo.jf.intel.com ([10.54.38.190]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2024 11:56:05 -0700 From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [PATCH v8 12/12] Mark expand musttail error messages for translation Date: Sat, 22 Jun 2024 11:54:44 -0700 Message-ID: <20240622185557.1589179-13-ak@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622185557.1589179-1-ak@linux.intel.com> References: <20240622185557.1589179-1-ak@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The musttail error messages are reported to the user, so must be translated. gcc/ChangeLog: * calls.cc (initialize_argument_information): Mark messages for translation. (can_implement_as_sibling_call_p): Dito. (expand_call): Dito. --- gcc/calls.cc | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/gcc/calls.cc b/gcc/calls.cc index 883eb9971257..f28c58217fdf 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -1420,9 +1420,9 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, { *may_tailcall = false; maybe_complain_about_tail_call (exp, - "a callee-copied argument is" - " stored in the current" - " function's frame"); + _("a callee-copied argument is" + " stored in the current" + " function's frame")); } args[i].tree_value = build_fold_addr_expr_loc (loc, @@ -1489,8 +1489,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, type = TREE_TYPE (args[i].tree_value); *may_tailcall = false; maybe_complain_about_tail_call (exp, - "argument must be passed" - " by copying"); + _("argument must be passed" + " by copying")); } arg.pass_by_reference = true; } @@ -2508,8 +2508,8 @@ can_implement_as_sibling_call_p (tree exp, { maybe_complain_about_tail_call (exp, - "machine description does not have" - " a sibcall_epilogue instruction pattern"); + _("machine description does not have" + " a sibcall_epilogue instruction pattern")); return false; } @@ -2519,7 +2519,7 @@ can_implement_as_sibling_call_p (tree exp, sibling calls will return a structure. */ if (structure_value_addr != NULL_RTX) { - maybe_complain_about_tail_call (exp, "callee returns a structure"); + maybe_complain_about_tail_call (exp, _("callee returns a structure")); return false; } @@ -2528,8 +2528,8 @@ can_implement_as_sibling_call_p (tree exp, if (!targetm.function_ok_for_sibcall (fndecl, exp)) { maybe_complain_about_tail_call (exp, - "target is not able to optimize the" - " call into a sibling call"); + _("target is not able to optimize the" + " call into a sibling call")); return false; } @@ -2537,18 +2537,18 @@ can_implement_as_sibling_call_p (tree exp, optimized. */ if (flags & ECF_RETURNS_TWICE) { - maybe_complain_about_tail_call (exp, "callee returns twice"); + maybe_complain_about_tail_call (exp, _("callee returns twice")); return false; } if (flags & ECF_NORETURN) { - maybe_complain_about_tail_call (exp, "callee does not return"); + maybe_complain_about_tail_call (exp, _("callee does not return")); return false; } if (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr)))) { - maybe_complain_about_tail_call (exp, "volatile function type"); + maybe_complain_about_tail_call (exp, _("volatile function type")); return false; } @@ -2567,7 +2567,7 @@ can_implement_as_sibling_call_p (tree exp, the argument areas are shared. */ if (fndecl && decl_function_context (fndecl) == current_function_decl) { - maybe_complain_about_tail_call (exp, "nested function"); + maybe_complain_about_tail_call (exp, _("nested function")); return false; } @@ -2579,8 +2579,8 @@ can_implement_as_sibling_call_p (tree exp, crtl->args.size - crtl->args.pretend_args_size)) { maybe_complain_about_tail_call (exp, - "callee required more stack slots" - " than the caller"); + _("callee required more stack slots" + " than the caller")); return false; } @@ -2594,15 +2594,15 @@ can_implement_as_sibling_call_p (tree exp, crtl->args.size))) { maybe_complain_about_tail_call (exp, - "inconsistent number of" - " popped arguments"); + _("inconsistent number of" + " popped arguments")); return false; } if (!lang_hooks.decls.ok_for_sibcall (fndecl)) { - maybe_complain_about_tail_call (exp, "frontend does not support" - " sibling call"); + maybe_complain_about_tail_call (exp, _("frontend does not support" + " sibling call")); return false; } @@ -2657,7 +2657,7 @@ expand_call (tree exp, rtx target, int ignore) so this shouldn't really happen unless the the musttail pass gave up walking before finding the call. */ if (!try_tail_call) - maybe_complain_about_tail_call (exp, "other reasons"); + maybe_complain_about_tail_call (exp, _("other reasons")); int pass; /* Register in which non-BLKmode value will be returned, @@ -3031,7 +3031,7 @@ expand_call (tree exp, rtx target, int ignore) there's cleanups, as we know there's code to follow the call. */ if (currently_expanding_call++ != 0) { - maybe_complain_about_tail_call (exp, "inside another call"); + maybe_complain_about_tail_call (exp, _("inside another call")); try_tail_call = 0; } if (!flag_optimize_sibling_calls @@ -3040,7 +3040,7 @@ expand_call (tree exp, rtx target, int ignore) try_tail_call = 0; if (args_size.var) { - maybe_complain_about_tail_call (exp, "variable size arguments"); + maybe_complain_about_tail_call (exp, _("variable size arguments")); try_tail_call = 0; } if (dbg_cnt (tail_call) == false) @@ -3065,7 +3065,7 @@ expand_call (tree exp, rtx target, int ignore) { try_tail_call = 0; maybe_complain_about_tail_call (exp, - "hidden string length argument passed on stack"); + _("hidden string length argument passed on stack")); break; } } @@ -3113,9 +3113,9 @@ expand_call (tree exp, rtx target, int ignore) { try_tail_call = 0; maybe_complain_about_tail_call (exp, - "caller and callee disagree in" - " promotion of function" - " return value"); + _("caller and callee disagree in" + " promotion of function" + " return value")); } } @@ -4025,7 +4025,7 @@ expand_call (tree exp, rtx target, int ignore) if (try_tail_call) /* Ideally we'd emit a message for all of the ways that it could have failed. */ - maybe_complain_about_tail_call (exp, "tail call production failed"); + maybe_complain_about_tail_call (exp, _("tail call production failed")); } currently_expanding_call--;