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.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 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=1672998970; 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=theS8uZU7/R+68WMLEhSfgB+tV0DFioW5ptXAmRdLXE=; b=grR9lczncZNOS6cx8chu73Z44fc+IXPC7qCkO7Insg3L4bSyIhHTjGHaOoyO6RISp5ujdO MOFq6wJyWzblACG7EJCONbt5L7L5GYJNnTBMZMsEqLo94LTdFkpXUJ14Nqb5p0k3CfdYet soseV8qPHgHBsB96DmQ+WIdcBELdUC0= 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 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcases from PR108292 and PR108308 Message-ID: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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; +} Jakub