From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673605023; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=1xWU5c1ZQRfeEo1JC5R3I7uDJayEtMedNRP1E2lhfEY=; b=Io7wfYdmUaescn4TDx0ar24e9nvmGb90KS7W+iUN+SApydYcR9+jbW4eHzZgAqJREkrnii aZfLsUbI66ia+UMW1IVkmgKjNr9lrDJg0XC4p02PyCXTA8+vNrG26vgHaldMPQmv08Tj7C CUyc/UavFvwgL3sEfxPGaJaA4lHX8hQ= 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 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for PR that went latent in GCC 13 [PR107131] Message-ID: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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; +} Jakub