From patchwork Tue Jul 25 21:55:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 125828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp30667vqo; Tue, 25 Jul 2023 14:56:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2Ovz9xhUQuASimfYLw4ZTcDGtEQoL0N1JrT7CTgGK5CXtV1kPm5SiucvRnh835a1atUMD X-Received: by 2002:a17:907:270b:b0:994:13c3:2f89 with SMTP id w11-20020a170907270b00b0099413c32f89mr420866ejk.27.1690322190536; Tue, 25 Jul 2023 14:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690322190; cv=none; d=google.com; s=arc-20160816; b=K6ILts32D7AseF+Kswh6ZUXtjzhtNqUPyiyJl0niv7MDQpnBdy+kGo6KBmNdMEYSE7 ddfArosvjBdCW6pSxUslWDenT/QgoaIIf8Di877eKrGvNpfJoztUp5wZlET42o7kkyRP aGc6FLwDT1qBYKEDQ0GGab94owB6rOK/3WkdZQrS6WR21Lyx8LY6lQNfk31fPmWxkk+M zbOPXIwNba+3KH2hF4yxFtF0VtJJM7VG0TP8drAdPLpb+qgBDHxxvQsaXVmylyrmsjYK Tr7a5bMpvZASA8CtmD7rUt39qNzQY+aR+JJwVECnUBMvD5Zy0vvh/Id36xy+RLfM5Rd7 ieAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=KolsT4jIon40NT0bT+gaHt/CNNAb6R13QA2vwIFyFHY=; fh=09okz+w4tVyhQmqNBttR063P0zKcIsLE1JRBioNPGC4=; b=KlGQJfZUtNOX7rhOBL5gSl2Gy9uWJLwuamD8KhN8mTurFg6WjheskpRnLxbG5+b2YD SATLgNkWNyAL5C1vKlKc5DwXlMdbHVRpkQy/lOjds2OkfwaLy/iWuFsphHYOOd7NZh5P s34RVwv2k7K+LIfIfafQbnpRRfAUwm01nWydLBEcTagwfKVbUdsmSBkZs1WDOcp0vvKD JANkIWYvm7NOY/umgz/o1Hqp9jpE2nIZCH9hac52DV66LyfczQoJDF/YTcQae6hMRkJv l/Lahha6zuDeuQ7+XZnNZYbvTm1VPX0go6fYiWXAkc+AzIZuq4EeYlmIJ9pII/n8VUfG gk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ba8sWNSL; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t21-20020a1709066bd500b009937e7c4e53si8318103ejs.343.2023.07.25.14.56.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 14:56:30 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ba8sWNSL; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C0E0385C426 for ; Tue, 25 Jul 2023 21:56:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C0E0385C426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690322189; bh=KolsT4jIon40NT0bT+gaHt/CNNAb6R13QA2vwIFyFHY=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ba8sWNSLRsZeyWYSVpm+s0cljI2JztlPDZ/exkJfrpXX/02zc8W5fAZz6XRcPqQUO TU/iwSJJv4Gn0R96yo57IlSRZzRVqCi2bKQvA03YhqnEgybzN+2fHtExXiuh3zxFOT C2x14sqPxTAw8RJ6S6iW4hhNHXykHMAqP4UpOA3g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id B02B23858C33 for ; Tue, 25 Jul 2023 21:55:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B02B23858C33 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36PLHjFn032104 for ; Tue, 25 Jul 2023 14:55:46 -0700 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3s2by4jw9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 25 Jul 2023 14:55:46 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 25 Jul 2023 14:55:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 25 Jul 2023 14:55:44 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 43CB75B6946; Tue, 25 Jul 2023 14:55:44 -0700 (PDT) To: CC: Andrew Pinski Subject: [COMMITTED] Fix 110803: use of plain char instead of signed char Date: Tue, 25 Jul 2023 14:55:34 -0700 Message-ID: <20230725215534.1791062-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-GUID: nZLPabDG_tvhJ_uN9Wmn4zB6PNW_FT0P X-Proofpoint-ORIG-GUID: nZLPabDG_tvhJ_uN9Wmn4zB6PNW_FT0P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-25_12,2023-07-25_01,2023-05-22_02 X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772431281167859117 X-GMAIL-MSGID: 1772431281167859117 So the problem here is that plain char can either be signed or unsigned depending on the target (powerpc and aarch64 are unsigned while most other targets are signed). So the testcase gcc.c-torture/execute/pr109986.c was assuming plain char was signed char which is wrong so it is better to just change the `char` to be `signed char`. Note gcc.c-torture/execute/pr109986.c includes gcc.dg/tree-ssa/pr109986.c where the plain char was being used. Committed as obvious after a quick test to make sure gcc.c-torture/execute/pr109986.c now passes and gcc.dg/tree-ssa/pr109986.c still passes. gcc/testsuite/ChangeLog: PR testsuite/110803 * gcc.dg/tree-ssa/pr109986.c: Change plain char to be `signed char`. --- gcc/testsuite/gcc.dg/tree-ssa/pr109986.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c b/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c index 45f099b5656..0724510e5d5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109986.c @@ -16,14 +16,14 @@ t2 (int a, int b) return a ^ (~a | (unsigned int) b); } -__attribute__((noipa)) char -t3 (char a, char b) +__attribute__((noipa)) signed char +t3 (signed char a, signed char b) { return (b | ~a) ^ a; } __attribute__((noipa)) unsigned char -t4 (char a, char b) +t4 (signed char a, signed char b) { return ((unsigned char) a) ^ (b | ~a); } @@ -89,20 +89,20 @@ t12 (int a, unsigned int b) return t3; } -__attribute__((noipa)) char -t13 (char a, char b) +__attribute__((noipa)) signed char +t13 (signed char a, signed char b) { - char t1 = ~a; - char t2 = b | t1; - char t3 = t2 ^ a; + signed char t1 = ~a; + signed char t2 = b | t1; + signed char t3 = t2 ^ a; return t3; } __attribute__((noipa)) unsigned char -t14 (unsigned char a, char b) +t14 (unsigned char a, signed char b) { unsigned char t1 = ~a; - char t2 = b | t1; + signed char t2 = b | t1; unsigned char t3 = a ^ t2; return t3; }