From patchwork Mon Sep 12 12:19:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Benedict Glaw X-Patchwork-Id: 1164 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1852731wrt; Mon, 12 Sep 2022 05:20:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR54xg/03R/YqVcXHYdJguJo2/0wDEVjkHRKGoN61aChxrq9057xOi67fGDbzyy17PYdMnRK X-Received: by 2002:a05:6402:42c7:b0:451:e6a6:48b5 with SMTP id i7-20020a05640242c700b00451e6a648b5mr2549503edc.113.1662985205990; Mon, 12 Sep 2022 05:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662985205; cv=none; d=google.com; s=arc-20160816; b=oT7xh5FDsLKR48Akwp2ih6FVLJznorttB12ypJ2zg67ya2JIdo/4at6/GtE/Uqb07r RukPg3zsG6Fg2mwILtLjPD7e+rouGiWV3bqj+P17BQ+0ClUh7QYEALHDXDzJ17yRfCUA 8pGhpGYP7xiLCbXfMPHAFvfGqx+mQiRKSzAMgHkOCOGycJIGhyQrMzJf+/WXidNIlYjH d+4csUQUfeZtY99jNMiSwRT7h5TzdYRC5Ri7q03O7FW6tvEeQOIiomJ40qXjafdLonsx nGJHPTmixwl+gue1Sl5fdow78uJjfgVSkcAPS103VV5MUByHnNABPQMys8HeQ0nmVyWA iVuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dmarc-filter :delivered-to; bh=U1fv0o0DpApdv/XxoUEPMjsC5xr50rsQtjUVe05tsLM=; b=aojXnrdPY0B3y6ER0FaggzbWtvfFvRR0y6SvtM7DhKVS9Qn87ke7LoqNfp2cTr6jui aD5mIYFRA/6GeKhL9QbV1IWEiZgoRCzuSVX9DmVICYKb3K9lT7lVENlQ+sH8r+ExFhap iw6rZt/2Qglv878xkiz7xk5BL03o4hvG5DB4ZPadlmYuac5dylTG+cFF8Ab57F3J19JE ak7aS+pa3/8BcbAHmVfUFmd7eZ6tti5zE/lQLr4ZNJdUJmhsqMVo2SUOG4lhGkE1q7dU wpds0vHZs0RhYwPntAJKhaxB8VV7FGBuBXXWHCHeyTPtphIvWaPDnLysG1Ei69UJzyr4 W9lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cw8-20020a170906478800b0077c98d578f3si3300186ejc.955.2022.09.12.05.20.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 05:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 281013851A96 for ; Mon, 12 Sep 2022 12:20:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTPS id BB5BF385B839 for ; Mon, 12 Sep 2022 12:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB5BF385B839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id A435742039; Mon, 12 Sep 2022 14:19:23 +0200 (CEST) Date: Mon, 12 Sep 2022 14:19:23 +0200 From: Jan-Benedict Glaw To: gcc-patches@gcc.gnu.org, Xianmiao Qu , Yunhai Shang Subject: [PATCH] C-SKY: Fix unsigned comparison warning Message-ID: <20220912121923.fazqolix7neh77uz@lug-owl.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.14.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743766375313410732?= X-GMAIL-MSGID: =?utf-8?q?1743766375313410732?= Hi! When -mfloat-abi=hard support was added, a cast went missing that used to silence a warning in common code: /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o builtins.o -MT builtins.o -MMD -MP -MF ./.deps/builtins.TPo ../../gcc/gcc/builtins.cc In file included from ./tm.h:21, from ../../gcc/gcc/backend.h:28, from ../../gcc/gcc/builtins.cc:27: ../../gcc/gcc/builtins.cc: In function 'int apply_args_size()': ../../gcc/gcc/config/csky/csky.h:421:13: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits] 421 | (((REGNO) >= CSKY_FIRST_PARM_REGNUM \ ../../gcc/gcc/builtins.cc:1444:13: note: in expansion of macro 'FUNCTION_ARG_REGNO_P' 1444 | if (FUNCTION_ARG_REGNO_P (regno)) | ^~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[1]: *** [Makefile:1146: builtins.o] Error 1 The needed (int) cast is even mentioned in the comment above, so reinstate it here. 2022-09-06 Jan-Benedict Glaw gcc/ChangeLog: * config/csky/csky.h (FUNCTION_ARG_REGNO_P): Cast REGNO to (int) to prevent warning. Ok for HEAD? Thanks, Jan-Benedict diff --git a/gcc/config/csky/csky.h b/gcc/config/csky/csky.h index 37410f0cda4..730d1b44ef1 100644 --- a/gcc/config/csky/csky.h +++ b/gcc/config/csky/csky.h @@ -418,7 +418,7 @@ typedef struct The int cast is to prevent a complaint about unsigned comparison to zero, since CSKY_FIRST_PARM_REGNUM is zero. */ #define FUNCTION_ARG_REGNO_P(REGNO) \ - (((REGNO) >= CSKY_FIRST_PARM_REGNUM \ + (((int)(REGNO) >= CSKY_FIRST_PARM_REGNUM \ && (REGNO) < (CSKY_NPARM_REGS + CSKY_FIRST_PARM_REGNUM)) \ || FUNCTION_VARG_REGNO_P(REGNO))