From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=marvell.com 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=KolsT4jIon40NT0bT+gaHt/CNNAb6R13QA2vwIFyFHY=; b=JLLKZco+SWTGu0eoVTyNHetymkvEip10/FIRoFTMEz8ov4vRWxLClnE/NN6W9HO6UmOi 3ZoSES7ofCmREil2GspKlQW7VAJyfKdCTKLREYcr8VdiIoi9F9ixiV/vpOFwW2KeFi9s skT0+C19QG3pjvfAO/IMLU6Wt+Jy1ceLmWTiwDqXoN2AqlbbhO0VrGfpsXgM88/7g58+ ZdbCad6Y8kdRiyGo1mthDitLRtEqVDGwqfnn8hwjQ+gbezsStjPSfp6SeO6ZrhRwVFvt sS3RPlaXu64Y/+k31GsXoKk2I6t3g8SZAM3HyfcLh1GY5T7RKoKiqf6wqyGGNLkjp5Ld JA== 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) From: Andrew Pinski 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 List-Id: 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; } -- 2.31.1