From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id A70553858D1E; Tue, 31 Jan 2023 08:50:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A70553858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675155053; bh=Y4vUbA6RV2EEv+SOmYuLJSa4aHyVfNH8FKV/Lg2D86U=; h=From:To:Subject:Date:From; b=YQhXnDCS4OEOgEryfM/3QWMB+vChp646j2IFaw9qiBLR1VmKa2mU1lERZdJkm/w9e 5XkhnEzQ/ZFPpWPdVPHrdOe415WTfT2Px3aRXi0qZ4+eA+jbofuqxO95FIcwEqc7ba POLtKQVDZemzcaCQeKFQAXooKpugBNpBsKCVbrU8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5528] testsuite/108604 - gcc.dg/torture/pr108574-3.c hangs on unsigned char archs X-Act-Checkin: gcc X-Git-Author: Xianmiao Qu X-Git-Refname: refs/heads/master X-Git-Oldrev: 603a6fbcaac1e80aa90d1d26318c881a53473066 X-Git-Newrev: 78d6489f736963a8a07c494294c72662c49e8e63 Message-Id: <20230131085053.A70553858D1E@sourceware.org> Date: Tue, 31 Jan 2023 08:50:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:78d6489f736963a8a07c494294c72662c49e8e63 commit r13-5528-g78d6489f736963a8a07c494294c72662c49e8e63 Author: Xianmiao Qu Date: Tue Jan 31 09:49:06 2023 +0100 testsuite/108604 - gcc.dg/torture/pr108574-3.c hangs on unsigned char archs In the architecture where sign defaults to unsigned, the 'f' will be zero extended to int type in the expression 'd = ~(f & ~2880764155)', then the 'd' will become -1 wich cause the case to fail. So it's ok for the architectures where sign defaults to signed like x86, but failed for the architectures where sign defaults to unsigned like arm and csky. Change char to signed char to avoid this problem. PR testsuite/108604 gcc/testsuite: * gcc.dg/torture/pr108574-3.c (b, f): Change type from char to signed char. Diff: --- gcc/testsuite/gcc.dg/torture/pr108574-3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/torture/pr108574-3.c b/gcc/testsuite/gcc.dg/torture/pr108574-3.c index 3c9146e31ac..b4d5dae9f80 100644 --- a/gcc/testsuite/gcc.dg/torture/pr108574-3.c +++ b/gcc/testsuite/gcc.dg/torture/pr108574-3.c @@ -1,7 +1,7 @@ /* { dg-do run } */ int a = 3557301289, d; -char b, f; +signed char b, f; unsigned short c = 241; short e, g; static void h() {