From patchwork Tue Nov 8 11:50:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 16996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2653100wru; Tue, 8 Nov 2022 03:50:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM7p6qsti7AtFIiCy+7urxUf6rXTgwPgRctXfqAqSWaZ3ov/tO/9l7QohKvPVq9r1E0EBifP X-Received: by 2002:a05:6402:5:b0:463:39ab:c1da with SMTP id d5-20020a056402000500b0046339abc1damr48727202edu.166.1667908258310; Tue, 08 Nov 2022 03:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667908258; cv=none; d=google.com; s=arc-20160816; b=Vr+W98S5r3HLajaDaxCSBE7a2BG71stmC9G9jYtx0h1mrmUA69DA9H0jE5CqSNbfNp H3RoydZ6tEkOGP/xkyQ+FCklyDLUJ5ai3FUDVmmCU/wngnKBAMHEJ+L0KgH6t2VZ7oNN 4EsPVRM74TiIu3d04/4a9VsnVvqaGtnJZNP3mpSel5d7sOItY+40Zyj1MUYmeN9CN+lF +Pf29TeNsryneOVKHx0nSo8s27k4y6u4ng2YiUbaRzqmSEevzAD/JOfqdX7fSrw+sQgA m3CSCIl8gX72Dz/hxOaLk10UGE+bkRtYPznRMnC634S75U8q6BsBWP0YYG2d7YFJL+ba NYxQ== 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-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=jQKr2SW1WQiA+QJZWaeyjwT/lQrwEFR5ZRPoImBcCso=; b=CZSTPzHaaV3jIVfeB2zCnevvmZEFQcJGO6WIf2KHwJL3uc3ckZ+Hp1uGyKV0E0S5/B 2lq9qfbop+4BsmqS/WtSBcZ4p2ky+jXNZSPvkNTmplE50VLwGdPLT4zy4mNIORWNNFia s2ln9Z22l6+xBWc/udCK2s+1AwzFvrJgsvMIoFcsp6cjIEaS5Ml1NcU7lFFScico3tMy X4Cp8wJiIe2A70wtq7xazgk7wG7H1jWDaHMrZBCHmaRCPHc/ZKpYr4r4UZHhTbzpu0EK 3xd2ByhLvALzR++jLsdJxxMpci3siA9m4UQESDEmGV13hAoKxNq4itMBJwJmVU0vvbNo rbuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=g4YTm8Vc; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s14-20020a508d0e000000b00462f85ee700si12084047eds.65.2022.11.08.03.50.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 03:50:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=g4YTm8Vc; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 6C6F738582A8 for ; Tue, 8 Nov 2022 11:50:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C6F738582A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667908256; bh=jQKr2SW1WQiA+QJZWaeyjwT/lQrwEFR5ZRPoImBcCso=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=g4YTm8VcbtpxwkGfPto2a3gOV0k6Kdw/i7ocfypJPbKR5kg497Oof+ny5G5qH9Jcy aUnpN6eEd1Apax59Xfng3LuB0iRw1KvnNkMWPPlHgUDfv4aEgiYw9b4chgZwN1gnmF fXwF7LlJ2f24O/+ghsUR2eoeZNNZnT3049QgXT9Y= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DC88F3858416 for ; Tue, 8 Nov 2022 11:50:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC88F3858416 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-27-9KnFtTD9N2OPnr0iielPbQ-1; Tue, 08 Nov 2022 06:50:10 -0500 X-MC-Unique: 9KnFtTD9N2OPnr0iielPbQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25A7C101CC67 for ; Tue, 8 Nov 2022 11:50:10 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF8D14EA47; Tue, 8 Nov 2022 11:50:09 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2A8Bo6J62242149 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 8 Nov 2022 12:50:06 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2A8Bo6Tv2242148; Tue, 8 Nov 2022 12:50:06 +0100 Date: Tue, 8 Nov 2022 12:50:05 +0100 To: Aldy Hernandez Cc: GCC patches , Andrew MacLeod Subject: [PATCH] testsuite: Fix up pr107541.c test Message-ID: References: <20221107114238.663927-1-aldyh@redhat.com> MIME-Version: 1.0 In-Reply-To: <20221107114238.663927-1-aldyh@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748928569924667386?= X-GMAIL-MSGID: =?utf-8?q?1748928569924667386?= On Mon, Nov 07, 2022 at 12:42:38PM +0100, Aldy Hernandez via Gcc-patches wrote: > * gcc.dg/tree-ssa/pr107541.c: New test. The test fails when long is 32-bit rather than 64-bit (say x86_64 with RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} tree-ssa.exp=pr107541.c' ). I've tweaked it to use long long so it passes even on the 32-bit targets, and added an early out for weirdo targets because I think the test assumes the usual 1/2/4/8 bytes sizes for char/short/int/long long. Tested on x86_64-linux, ok for trunk? 2022-11-08 Jakub Jelinek PR tree-optimization/107541 * gcc.dg/tree-ssa/pr107541.c (c): Use long long type rather than long. (main): Punt if sizeof short isn't 2, or int 4, or long long 8. Jakub --- gcc/testsuite/gcc.dg/tree-ssa/pr107541.c.jj 2022-11-07 15:12:24.519022064 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/pr107541.c 2022-11-08 12:45:12.926718243 +0100 @@ -3,9 +3,11 @@ unsigned char a = 1; char b, e; -long c; +long long c; short d; int main() { + if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8) + return 0; a = ~(1 && a); c = ~((~a / 8 | -2) & 11007578330939886389LLU); e = -c;