Message ID | 20240115092537.1706919-1-iii@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA8193858C39 for <patchwork@sourceware.org>; Mon, 15 Jan 2024 09:26:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B6C4A3858D28; Mon, 15 Jan 2024 09:25:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6C4A3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B6C4A3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705310760; cv=none; b=C9gZCd3xENpQcVHcIG6EdjwEJH7nX0P1oUeHGIXZrJHsic0yPeSXS083aDXWwtrIPUmRHl8B+xIyIgmemi3juxJQLNlKktydAn6ZBueihDfIA3euI14cnErTz/75o5Y4mV/4sYa21iUfcO4Upnfj4U00bb0HcpJsUr/dLtdkVxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705310760; c=relaxed/simple; bh=eUcckIyCtaKGxtiZh4zjXzRFKqhaL3JKkpCnS6+/9dc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=f+Z/c7Na+OoowsbCE7d0rOJ8KTvoOb0HDnwVEDh3ujILfv63Dzf0oC2d3+oq6vICHOeygV3/r5wkAGXA36rS3bN6WHW4G0ghzg1vN2i0JZ8/3uoqcJuWvMMqsr2dM0MQ7xf68xTkueeqG5lhtxSSRkCDFyBLaxuH/d+0IW81A48= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40F9BfaK026888; Mon, 15 Jan 2024 09:25:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=A2LSQ8vMpz+OZwPpBFg8JcIQ2VjGtNACd7v5vjqtYE4=; b=o2STGYQbBrBW1STwF5iPQQNYKrfMG0rIh43ZmJK2PbiDwZsD1c13arWpBEvb7NNlXGRF H3q4M+OimhH41kIA5I8o2WJrroAKGllnFXS2an6RlxUZ85BsMB7KEQs00qU7h//2EErx Lk9YgeeN97vTyG5lElpyAm2fVqd1okqZz9a9olOu4AhQAQdgEwPUDlX6I2a2XmnpMM5l VF+U8satnw5slI+OL7Bwz8HtN5X07PucPdrnwDd8/yX6v4dGL6ZPltsAQ6ZMvqIIRH4v r1jwp3u5/KnKNbhPdtLUFccAsjDTVB/g7CAOhKAuiuVH1ywSPHHHEqZAHT7CUXHhrgDh DA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vmyhaubgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 09:25:56 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 40F9GVie011075; Mon, 15 Jan 2024 09:25:55 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vmyhaubg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 09:25:55 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40F8EAFi018637; Mon, 15 Jan 2024 09:25:54 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3vm5un7cfw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jan 2024 09:25:54 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40F9PoJ02032178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jan 2024 09:25:50 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B55EC20043; Mon, 15 Jan 2024 09:25:50 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 275A920040; Mon, 15 Jan 2024 09:25:50 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.0.80]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 15 Jan 2024 09:25:49 +0000 (GMT) From: Ilya Leoshkevich <iii@linux.ibm.com> To: Jeff Law <jlaw@ventanamicro.com>, Jakub Jelinek <jakub@redhat.com> Cc: Jan-Benedict Glaw <jbglaw@lug-owl.de>, Andreas Krebbel <krebbel@gcc.gnu.org>, gcc-patches@gcc.gnu.org, Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH] Mark ASM_OUTPUT_FUNCTION_LABEL ()'s DECL argument as used Date: Mon, 15 Jan 2024 10:22:28 +0100 Message-ID: <20240115092537.1706919-1-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MlI-qhj4YGq12UJqbx1lhRAmbcOiJxuL X-Proofpoint-GUID: OcFNjshB2RfFNRC_uIctNhY8GuOQnsXp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-15_04,2024-01-15_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401150068 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series |
Mark ASM_OUTPUT_FUNCTION_LABEL ()'s DECL argument as used
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 | success | Testing passed |
Commit Message
Ilya Leoshkevich
Jan. 15, 2024, 9:22 a.m. UTC
Compile tested for the ia64-elf target; bootstrap and regtest running
on x86_64-redhat-linux. Ok for trunk when successful?
ia64-elf build fails with the following warning:
[all 2024-01-12 16:32:34] ../../gcc/gcc/config/ia64/ia64.cc:3889:59: error: unused parameter 'decl' [-Werror=unused-parameter]
[all 2024-01-12 16:32:34] 3889 | ia64_start_function (FILE *file, const char *fnname, tree decl)
decl is passed to ASM_OUTPUT_FUNCTION_LABEL (), whose default
implementation does not use it. Mark it as used in order to avoid the
warning.
Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Suggested-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Fixes: c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
gcc/ChangeLog:
* defaults.h (ASM_OUTPUT_FUNCTION_LABEL): Mark DECL as used.
---
gcc/defaults.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Comments
On 1/15/24 02:22, Ilya Leoshkevich wrote: > Compile tested for the ia64-elf target; bootstrap and regtest running > on x86_64-redhat-linux. Ok for trunk when successful? > > > > ia64-elf build fails with the following warning: > > [all 2024-01-12 16:32:34] ../../gcc/gcc/config/ia64/ia64.cc:3889:59: error: unused parameter 'decl' [-Werror=unused-parameter] > [all 2024-01-12 16:32:34] 3889 | ia64_start_function (FILE *file, const char *fnname, tree decl) > > decl is passed to ASM_OUTPUT_FUNCTION_LABEL (), whose default > implementation does not use it. Mark it as used in order to avoid the > warning. > > Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> > Suggested-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> > Fixes: c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL") > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> > > gcc/ChangeLog: > > * defaults.h (ASM_OUTPUT_FUNCTION_LABEL): Mark DECL as used. So normally the way to go is to just remove the unused argument's name, leaving its type. But in this case we're passing the unused argument into a generic macro. So ISTM the better way to go here is decorate the argument with ATTRIBUTE_UNUSED in ia64.cc. This has the ever-so-slight advantage that if/when the ia64 port goes away that the hack goes away too. Something like the attached, which I'd consider pre-approved. Jeff diff --git a/gcc/config/ia64/ia64.cc b/gcc/config/ia64/ia64.cc index 53a4444d03b..a2011a9a811 100644 --- a/gcc/config/ia64/ia64.cc +++ b/gcc/config/ia64/ia64.cc @@ -3886,7 +3886,7 @@ ia64_expand_prologue (void) /* Output the textual info surrounding the prologue. */ void -ia64_start_function (FILE *file, const char *fnname, tree decl) +ia64_start_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED) { #if TARGET_ABI_OPEN_VMS vms_start_function (fnname);
On Tue, Jan 16, 2024 at 07:32:03PM -0700, Jeff Law wrote: > > > On 1/15/24 02:22, Ilya Leoshkevich wrote: > > Compile tested for the ia64-elf target; bootstrap and regtest running > > on x86_64-redhat-linux. Ok for trunk when successful? > > > > > > > > ia64-elf build fails with the following warning: > > > > [all 2024-01-12 16:32:34] ../../gcc/gcc/config/ia64/ia64.cc:3889:59: error: unused parameter 'decl' [-Werror=unused-parameter] > > [all 2024-01-12 16:32:34] 3889 | ia64_start_function (FILE *file, const char *fnname, tree decl) > > > > decl is passed to ASM_OUTPUT_FUNCTION_LABEL (), whose default > > implementation does not use it. Mark it as used in order to avoid the > > warning. > > > > Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> > > Suggested-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> > > Fixes: c659dd8bfb55 ("Implement ASM_DECLARE_FUNCTION_NAME using ASM_OUTPUT_FUNCTION_LABEL") > > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> > > > > gcc/ChangeLog: > > > > * defaults.h (ASM_OUTPUT_FUNCTION_LABEL): Mark DECL as used. > So normally the way to go is to just remove the unused argument's name, > leaving its type. But in this case we're passing the unused argument into a > generic macro. > > So ISTM the better way to go here is decorate the argument with > ATTRIBUTE_UNUSED in ia64.cc. This has the ever-so-slight advantage that > if/when the ia64 port goes away that the hack goes away too. > > Something like the attached, which I'd consider pre-approved. > > Jeff > diff --git a/gcc/config/ia64/ia64.cc b/gcc/config/ia64/ia64.cc > index 53a4444d03b..a2011a9a811 100644 > --- a/gcc/config/ia64/ia64.cc > +++ b/gcc/config/ia64/ia64.cc > @@ -3886,7 +3886,7 @@ ia64_expand_prologue (void) > /* Output the textual info surrounding the prologue. */ > > void > -ia64_start_function (FILE *file, const char *fnname, tree decl) > +ia64_start_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED) Except the too long line sure, that is what I'd go with as well. Jakub
On Tue, Jan 23, 2024 at 11:10:05AM +0100, Jakub Jelinek wrote: > > --- a/gcc/config/ia64/ia64.cc > > +++ b/gcc/config/ia64/ia64.cc > > @@ -3886,7 +3886,7 @@ ia64_expand_prologue (void) > > /* Output the textual info surrounding the prologue. */ > > > > void > > -ia64_start_function (FILE *file, const char *fnname, tree decl) > > +ia64_start_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED) > > Except the too long line sure, that is what I'd go with as well. Tested with a cross to ia64-linux (both without the patch and with the patch), committed to trunk as obvious. Jakub
diff --git a/gcc/defaults.h b/gcc/defaults.h index 92f3e07f742..1a2ea68a543 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -149,8 +149,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see NAME, such as the label on a function. */ #ifndef ASM_OUTPUT_FUNCTION_LABEL -#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \ - assemble_function_label_raw ((FILE), (NAME)) +#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \ + do { \ + (void) (DECL); \ + assemble_function_label_raw ((FILE), (NAME)); \ + } while (0) #endif /* Output the definition of a compiler-generated label named NAME. */