From patchwork Fri Jan 13 10:16:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 43130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp188329wrt; Fri, 13 Jan 2023 02:17:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXvzdC5W/9rLYL/soVriL+asMpSlQ7c+bPIZju/Q5iHHLhh73ot592FKbN7AxhwtoNLDL+JI X-Received: by 2002:a05:6402:50e:b0:49b:4711:f4b4 with SMTP id m14-20020a056402050e00b0049b4711f4b4mr6377304edv.0.1673605066932; Fri, 13 Jan 2023 02:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673605066; cv=none; d=google.com; s=arc-20160816; b=wrr+hfjGztaYL1bW8yDw0sZvL7wRCwMt/bEyxcrsSB3SpLLmuEFMiIDFWkVgv8h027 O8Tl9jioFI0qDfcsqJk44NaCekeqp3GKXmYG+aaPRw8q/63XE+qM3xd79N/R944B2RL9 irOmDg++p+BzHALEDcNNVcB4gX6WvJ7xDqk89WO8dyY5G6ybCOXEwIbjGDtM+RiwzZrv oQCo59HgHZb3YnacZlC9rQBf9tDO5jsHEPCIKOC3pGwAWzmp7pbk0uH8u3mjsdVKceVn lMdDjI4JQKXrGFqnPD/JKU/LRW1uACtyDGp87zLIASGLLQtv3hI3JNYMNsZYGerSwWZW SqkA== 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=1xWU5c1ZQRfeEo1JC5R3I7uDJayEtMedNRP1E2lhfEY=; b=g4DjYYkbMwsvEBTTXNmhx2jYAfqtBPU/d7f4DMB9J0m66t9UBFZ1NGACdF5fhCKolh 1rds038bZf7lLuh/9po1LPVV7VLfarhvi/Tdxd+cLkbs5LsQ6GAtu9jyj9bjnLcobMKU 2Z+Z2GKuRwZjDUv7rLipPnRRd7mvabYHNb8GBJFXofPoLqSsBWRfjS1MQ7IaoW2jSe4Z dXuFilH+aDB4tG3FTqnGtBSOAHjFtzz8F6AHklM07jnnXDWioEElRwX14q2a+X/1ypQo 7kSuoQ+OuK/317LkqTTGGLIiJ+gezwahLlNTGm0l3iQAEr1zeWAVWGRuhLo8tvqldPBI xy6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=yYwGz2ZK; 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 t4-20020a056402524400b0046bd9b65cd9si13014421edd.242.2023.01.13.02.17.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 02:17:46 -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=yYwGz2ZK; 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 DC76D3854380 for ; Fri, 13 Jan 2023 10:17:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC76D3854380 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673605065; bh=1xWU5c1ZQRfeEo1JC5R3I7uDJayEtMedNRP1E2lhfEY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=yYwGz2ZKUOuV81j9YqwGerQK4edCMOG7qAGxe8CIEke+u6B9qa0XgaWL7rx1eaWMu /w7sJeqSl15vu+1qDXbAPyr6zTkKiWLz2AEtb0hokqOsEER6HlJ3ep+tvB4JFotVBL TRud47R7Cwo3DMw09Wbg5QdWRt5p7I+iTFfYya3M= 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 936933858D32 for ; Fri, 13 Jan 2023 10:17:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 936933858D32 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-121-MyJ22SdIMISPSWaM9TES9g-1; Fri, 13 Jan 2023 05:17:01 -0500 X-MC-Unique: MyJ22SdIMISPSWaM9TES9g-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 7BC983C02550 for ; Fri, 13 Jan 2023 10:17:01 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 396A351EF for ; Fri, 13 Jan 2023 10:17:01 +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 30DAGwfr1353573 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 13 Jan 2023 11:16:59 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 30DAGw1J1353572 for gcc-patches@gcc.gnu.org; Fri, 13 Jan 2023 11:16:58 +0100 Date: Fri, 13 Jan 2023 11:16:57 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for PR that went latent in GCC 13 [PR107131] Message-ID: MIME-Version: 1.0 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.8 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?1754902106589955453?= X-GMAIL-MSGID: =?utf-8?q?1754902106589955453?= Hi! The following testcase is probably latent since r13-3217-gc4d15dddf6b9e. Adding testcase so that it doesn't silently reappear. Tested on x86_64-linux and i686-linux and with GCC 12 where it FAILs, committed to trunk as obvious. 2023-01-13 Jakub Jelinek PR target/107131 * gcc.dg/pr107131.c: New test. Jakub --- gcc/testsuite/gcc.dg/pr107131.c.jj +++ gcc/testsuite/gcc.dg/pr107131.c @@ -0,0 +1,30 @@ +/* PR target/107131 */ +/* { dg-do run } */ +/* { dg-options "-Os -fno-ipa-vrp -fno-tree-bit-ccp -Wno-psabi" } */ + +typedef unsigned char C; +typedef unsigned long long __attribute__((__vector_size__ (32))) U; +typedef unsigned long long __attribute__((__vector_size__ (64))) V; + +static __attribute__((__noclone__)) C +foo (C o, U x, U y, U z) +{ + V a = __builtin_shufflevector (x, x, 3, 1, 3, 0, 0, 1, 1, 3); + V b = (V) { } >= o; + V c = b <= (V)(b >= (V) { 0, 0, 0, 0, 0, 0x90DF0BE3990AC871ULL }); + U d = __builtin_shufflevector (y, z, 3, 1, 4, 5); + V e = a + c; + U f = ((union { V v; U u[2]; }) e).u[1] + d; + return ((union { U u; C c[32]; }) f).c[9]; +} + +int +main () +{ + if (__SIZEOF_LONG_LONG__ != 8 || __CHAR_BIT__ != 8) + return 0; + C x = foo (0, (U) { }, (U) { }, (U) { }); + if (x != 0xff) + __builtin_abort(); + return 0; +}