From patchwork Fri Jan 6 09:56:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 40063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp738616wrt; Fri, 6 Jan 2023 01:56:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaVvFyn/rRTcJEkJZ5caHd25/1wHtluUjzhRazZOdG8o1B3yu2k8d03jy/RvxdoPtiH2FR X-Received: by 2002:aa7:d653:0:b0:47e:15ec:155e with SMTP id v19-20020aa7d653000000b0047e15ec155emr44711661edr.26.1672999017171; Fri, 06 Jan 2023 01:56:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672999017; cv=none; d=google.com; s=arc-20160816; b=EoUSCuQMIvoXtgMKChaHkEQBONTYJRX3kmxGM7BmgGmOIIdGN1+x/bQAFSX+n0m+aV vYMORu0r9VxVUlFyZOacvbHOhYcx5JvkMdzVGUw7yRbmzlAXi0dPz7QeI8ggZ1KL+o0l mdwA3LvXKtDAWxIKysXNW2iHjkF7D2mtziwt0UeEvb2zi5DhXIQXY905p1BkwP08E7x4 wUqYpJXWfvdttcnPyG1r53KuMfmCQl85Pn5aaTkIRBJ4odqOxwdNKCN4SxAgHqhox6NX fyMbJEBhXHp+SDxFuSFNIYG/uBn8k2pDFf0GOulwTzNOkpUgKPU3MXYDbt5KX5/v+Sjg ILwQ== 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:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=theS8uZU7/R+68WMLEhSfgB+tV0DFioW5ptXAmRdLXE=; b=fh0+i7v74Z+Yn6hXdHVWyhySEBETJltbDGw4GRxpzsQXgII2lOa2q9Xy2njQVwJ/Gk R6vBVc9cmK2J+rrKECSoY1G/sJxbqVnE3wdDpHn0s24YzdTu7EePcBrnUTLljD6nmJP+ txBIvY1UwbpFA3rc2bUYpNZe08k3Hd5X9L+oUCQcf/NerJCfDNbFe90Dn72V+9RoG+Gj NYpNwNWd2LXfNHhGU5eHNelThzBXcmkJoOEWmPKFpdzUmSmsbMkFNwtrgCnhTtBXaCJs nHDN/E8c8ZGmcpZZw1IOkGjrjJQ28lb/PTN4FSfjFnCZ0wIrZVkjW2XhjECXFaKR0oK3 Te5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eMXtnI7S; 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 b23-20020aa7cd17000000b0048db0688c50si873859edw.30.2023.01.06.01.56.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 01:56:57 -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=eMXtnI7S; 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 2B70B3858CDB for ; Fri, 6 Jan 2023 09:56:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B70B3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672999016; bh=theS8uZU7/R+68WMLEhSfgB+tV0DFioW5ptXAmRdLXE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=eMXtnI7SgHp3zFz0HYv7xmt/kkNJNmb0W+ysuk6tRSWnBYvShZ4hW0JDah/b8uKHY kqrs4kPvXPX60yOT8nrdCLW0IgGrNtqx+VQcW66kZJoMtA7ZUmwppiAtXeTvpcYI4d JAoPsQdW2fdPlF3Sgw5gaCr9KTrQN5Q5RKTBg2/I= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 32E733858D28 for ; Fri, 6 Jan 2023 09:56:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32E733858D28 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-41Qfgge8PEW0jeQuXSQi7g-1; Fri, 06 Jan 2023 04:56:09 -0500 X-MC-Unique: 41Qfgge8PEW0jeQuXSQi7g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3FBA11C0A594 for ; Fri, 6 Jan 2023 09:56:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F161B1400E44 for ; Fri, 6 Jan 2023 09:56:08 +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 3069u6DH515533 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 6 Jan 2023 10:56:06 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3069u5KX515532 for gcc-patches@gcc.gnu.org; Fri, 6 Jan 2023 10:56:05 +0100 Date: Fri, 6 Jan 2023 10:56:05 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcases from PR108292 and PR108308 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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?1754266617568183286?= X-GMAIL-MSGID: =?utf-8?q?1754266617568183286?= Hi! These PRs were for now fixed by reversion of the r13-4977 patch, but so that the problems don't reappear during stage 1, I'm adding testcase coverage from those PRs. Tested on x86_64-linux -m32/-m64 before r13-5038 (where all tests FAIL) and after it (where they PASS), committed to trunk as obvious. 2023-01-06 Jakub Jelinek PR target/108292 PR target/108308 * gcc.c-torture/execute/pr108292.c: New test. * gcc.target/i386/pr108292.c: New test. * gcc.dg/pr108308.c: New test. Jakub --- gcc/testsuite/gcc.c-torture/execute/pr108292.c.jj 2023-01-06 10:40:20.742991257 +0100 +++ gcc/testsuite/gcc.c-torture/execute/pr108292.c 2023-01-06 10:41:56.589597398 +0100 @@ -0,0 +1,18 @@ +/* PR target/108292 */ + +typedef unsigned V __attribute__((__vector_size__ (64))); + +V x; + +int +main () +{ + if (sizeof (unsigned) * __CHAR_BIT__ != 32) + return 0; + __builtin_sub_overflow (0, 6, &x[5]); + x >>= ((V){} != x) & 31; + for (unsigned i = 0; i < 16; i++) + if (x[i] != (i == 5)) + __builtin_abort (); + return 0; +} --- gcc/testsuite/gcc.target/i386/pr108292.c.jj 2023-01-06 10:50:12.382388648 +0100 +++ gcc/testsuite/gcc.target/i386/pr108292.c 2023-01-06 10:50:05.704485693 +0100 @@ -0,0 +1,15 @@ +/* PR target/108292 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -march=alderlake" } */ + +extern void foo (float *); + +extern int x; + +int +bar (void) +{ + float y; + foo (&y); + return y > x ? 1 : 2; +} --- gcc/testsuite/gcc.dg/pr108308.c.jj 2023-01-06 10:43:45.793009294 +0100 +++ gcc/testsuite/gcc.dg/pr108308.c 2023-01-06 10:43:40.218090375 +0100 @@ -0,0 +1,39 @@ +/* PR target/108308 */ +/* { dg-do run { target { ilp32 || lp64 } } } */ +/* { dg-options "-Os -fno-tree-ccp" } */ + +int a = 1, *d = &a, f = 2766708631, h; +unsigned b = -1, c, e, g; + +static void +foo (int j) +{ + if (a) + { + c = ~c; + while (e) + j = 0; + goto k; + } +l: + h = 1; +k: + *d = (!j) | 80; + int m = ~(~(-1 / b) | (a ^ 1)), n = ~(~g / (11 >> m)), o = -1 / n; + if (f) + { + b = 9518150474215344 ^ ~f; + f = 0; + if (c) + goto l; + if (o) + goto k; + } +} + +int +main () +{ + foo (1); + return 0; +}