From patchwork Mon Jul 8 16:56:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1958061 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=dl+dk7gh; 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 4WHr8Z2Vl1z1xpP for ; Tue, 9 Jul 2024 03:05:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9AB6E384A4A3 for ; Mon, 8 Jul 2024 17:05:00 +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 [192.198.163.11]) by sourceware.org (Postfix) with ESMTPS id A414A384A44D for ; Mon, 8 Jul 2024 17:00:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A414A384A44D 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 A414A384A44D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720458062; cv=none; b=tUUzsYN11tMBi5w1SUW33tW11s5UrW3YtVD0dAblW5acQMZ+x2MsaGIG6iqg2D/rY4473+SnFNXJRImpi4aL6fy4Dsrm0FRxwXdThNrvEZGcVppO3nrRrIrsx5I1uCxekxNxaA/FtgFCOGg1KS93wYbTeQIi7fZprJoxY36Z5ME= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720458062; c=relaxed/simple; bh=zUv5eLAp6HYmT/Ip8UJJ3DMDd9mjiu7T27I9R7jsoJY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JuBz5sg/DXlQGYr9oVJFfgMbrW9eEnY8O+C5RNtYg+TUVBhYRJe5sI8gwmUP8iuSjATN7ZyQCMzI3LcemRj+B8vTh05IgbQv0qhbI89Wg+TE4saIU02g6YhYji7rkfURD6cllcLjFyxuDAHVe4ob7TunjsvW12fbulhHJ12MTCU= 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=1720458058; x=1751994058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zUv5eLAp6HYmT/Ip8UJJ3DMDd9mjiu7T27I9R7jsoJY=; b=dl+dk7gh3o0YN1jfF/7x1nufDDjSh0OS24ROnN7kGUhZDHfqqXlz4Sa7 p0Od6DhScuJDAtoWbRVb4lsDEuQnzKsMuypvv4IyfY5jozyIDX2hvb8+g BxNvkJwogyrTbY/+gIAXN0RXUjA2bYHCy+Hk3CZzVSAsdN1fVPEtyUsUo u8/CSBIBd3kslFmFjLNcCWsJZDC989codwy2P3IJJgZVvLax6KI3KwStS ksY0SGWgpttxwN8diYE5/DhaRYLQfWYlq8NqLpLODP8qAXLpchhTvBtWY MTYgwxRpezkMrfvpRCkn3OMBcqDEUCMoz2iHHt4Rb2c/T6u4o+HFku5dg w==; X-CSE-ConnectionGUID: 2cfGT0wNTjGAqnExKpWksA== X-CSE-MsgGUID: pxNbtIgDTIKKEFzcOKEUNA== X-IronPort-AV: E=McAfee;i="6700,10204,11127"; a="28279696" X-IronPort-AV: E=Sophos;i="6.09,192,1716274800"; d="scan'208";a="28279696" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 10:00:38 -0700 X-CSE-ConnectionGUID: AJAG3y67QtG8eoJcWF3/Pg== X-CSE-MsgGUID: hQc4+MBTSo2Bz2+J0bajAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,192,1716274800"; d="scan'208";a="47486302" Received: from tassilo.jf.intel.com ([10.54.38.190]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 10:00:38 -0700 From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, josmyers@redhat.com, polacek@redhat.com, jakub@redhat.com, Andi Kleen Subject: [PATCH v9 10/10] Mark expand musttail error messages for translation Date: Mon, 8 Jul 2024 09:56:02 -0700 Message-ID: <20240708170031.1621184-11-ak@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240708170031.1621184-1-ak@linux.intel.com> References: <20240708170031.1621184-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: PR83324 * 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--;