From patchwork Fri Aug 9 09:50:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1970884 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=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=JG6D/jjt; 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 4WgK4p2R02z1ybT for ; Fri, 9 Aug 2024 19:54:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9AB39385841C for ; Fri, 9 Aug 2024 09:54:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 6631F3858427 for ; Fri, 9 Aug 2024 09:51:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6631F3858427 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 6631F3858427 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723197069; cv=none; b=gwmzD/lmd5NJmSroGWhli+I8GquZI7GLpIaHuBq4S7+CSbb+v1lzKtxg2VxX/s3T01ewf7u2cfzs5BTa+msVjkCyso/NKOq+yL3T0KBFK+Xow3fCKEp4tqLAJX4wQBz18WvoFr7WPCV9OTSQwYu90E/EfYu+5K7SPSPO8dbHfYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723197069; c=relaxed/simple; bh=SMSM/rFsBcN1UnFvTtVjeqnyktQzyHTktV0XyxcdhHw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=JjP7I7p7F9yas6Fmijru3CmS2bzH0/NLNx19QfTf4XRn291oICThoyELPXHzMA0R0KSmZqjq0N8yzl4BYs6SZ6mjbGD5W3o+GOHzSWu3QLU3ogkJ8MEeQ0NIkR3sqzhWAoHGvMMiVdi+80D8nHRw8wrVDg8kJcqgj7xa9+1FD6Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4793wacR007797; Fri, 9 Aug 2024 09:51:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:date:mime-version:from:subject:to:cc:content-type :content-transfer-encoding; s=pp1; bh=CHD8UFybQMy83dKAx2YLer8BJU qo5L0K9GZNgPTKGuo=; b=JG6D/jjtcodmbHOTiPl35EqP6ymlHrgj1sVg6oiY1K 1dKse1d00U5tIZRJ64NLfs+yZM9LBiCx7YTMsaP4LnkEF+za4AcFfKVHVAUV8GBU JnVjXWTxoqKt8/eiBedih2SQ75dbebSWYMO2e8XcvbTPMJ91/l8GxNGPzPqwZNLJ hb1tUNkphf2jclDAcusMEeo7Q0vIbsapBoW5nt/LxIrbIPahFpAdkpyImcwcLDkn v8A9TKhWv6gwgOmyab1cQkKqlOlYB/sO9xJtOnPHDTNiD87BN2a/GLkoYAxJ86tr j6k4ZQUROi1Lo5vyyyxfM98Vkj7uX4lp99eKL8Zbyevg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40vwkcjg7d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2024 09:51:04 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4799p4Nv012816; Fri, 9 Aug 2024 09:51:04 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40vwkcjg78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2024 09:51:03 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4798riKO030631; Fri, 9 Aug 2024 09:51:03 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 40t1k3jj5d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2024 09:51:03 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4799ox2N44171582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Aug 2024 09:51:01 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82D752004F; Fri, 9 Aug 2024 09:50:59 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DA892004B; Fri, 9 Aug 2024 09:50:57 +0000 (GMT) Received: from [9.197.239.15] (unknown [9.197.239.15]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 9 Aug 2024 09:50:57 +0000 (GMT) Message-ID: Date: Fri, 9 Aug 2024 17:50:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US From: "Kewen.Lin" Subject: [PATCH] testsuite: Fix fam-in-union-alone-in-struct-2.c with unsigned char [PR116148] To: GCC Patches Cc: Richard Biener , Sam James , Qing Zhao , dave.anglin@bell.net X-TM-AS-GCONF: 00 X-Proofpoint-GUID: SSF_toxz5ZwUAM_swlHMQVjMrufxqZ6K X-Proofpoint-ORIG-GUID: _qlBpLJXm30GM1dKMV3xzQALgMoTpnP2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-09_06,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 impostorscore=0 mlxscore=0 mlxlogscore=890 spamscore=0 clxscore=1011 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408090070 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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 Hi, As PR116148#c7 shows, fam-in-union-alone-in-struct-2.c still fails on hppa which is a BE environment, but by checking more (also confirmed by John in PR116148#c12), it's due to that signedness of plain char on hppa is signed therefore the value of with_fam_3_v.a[7] "8f" get sign extended as "ffffff8f" then the verification will fail. This patch is to change plain char with unsigned char to avoid that. Tested well powerpc64-linux-gnu (BE) and powerpc64le-linux-gnu (LE), also confirmed to work on hppa by John. Is it ok for trunk? BR, Kewen ----- PR testsuite/116148 gcc/testsuite/ChangeLog: * c-c++-common/fam-in-union-alone-in-struct-2.c: Change the type of member a[] of union with_fam_3 with unsigned char. --- gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.1 diff --git a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c index 3743f9e7dac..920b4c4b7a7 100644 --- a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c +++ b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c @@ -14,7 +14,7 @@ union with_fam_2 { } with_fam_2_v = {.a = 0x1f2f3f4f}; union with_fam_3 { - char a[]; + unsigned char a[]; int b[]; } with_fam_3_v = {.b = {0x1f2f3f4f, 0x5f6f7f7f}};