From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 0D6EA385840C for ; Tue, 31 Jan 2023 08:51:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D6EA385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 86CA520462; Tue, 31 Jan 2023 08:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675155067; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ojJhd7IIF6G6nvpZBcySB5hT+diHd09DsmsghwMa9Rs=; b=BpLd9PovYTDHgFZXw5hpEqcTSJT/zDsdYCP86/lDkJl4PJw57X44EDuRkvlW+GuN1Qv6wS 5F4mD2faL7KJIhqiesfQr7RaQNbxxMs5mffTs2gQFgUscjmqgLWhvCcLHlhRIzt96mxifl R5KtuOpkQ7MZvEgtazgvzlUcpXVtj0o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675155067; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ojJhd7IIF6G6nvpZBcySB5hT+diHd09DsmsghwMa9Rs=; b=yufBUTT5WNy7cfuYK16zuAd4SaC2uIe2nUfKFX3wZylpdIc8o5esubrZYah77S0WbBo5L3 Kc//0Omjp7lvMlDg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 7F9062C141; Tue, 31 Jan 2023 08:51:07 +0000 (UTC) Date: Tue, 31 Jan 2023 08:51:07 +0000 (UTC) From: Richard Biener To: Xianmiao Qu cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] testsuite: Fix pr108574-3.c failed in arch where sign defaults to unsigned. In-Reply-To: Message-ID: References: <20230131061038.97059-1-cooper.qu@linux.alibaba.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: On Tue, 31 Jan 2023, Richard Biener wrote: > On Tue, 31 Jan 2023, Xianmiao Qu wrote: > > > 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. > > Whoops - thanks for fixing! > > OK. I've pushed the fix. Richard. > Richard. > > > gcc/testsuite: > > * gcc.dg/torture/pr108574-3.c (b, f): Change type from char to > > signed char. > > --- > > 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() { > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)