From patchwork Thu Dec 22 20:13:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Uecker X-Patchwork-Id: 35941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp143981wrn; Thu, 22 Dec 2022 12:14:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXtv+s+nkqOjnvgnU17EANYW9KTXdBMj7iVUkG4aM7zxe2XNuFhIbaehMjlJ/kDl6T3tU6Y3 X-Received: by 2002:a17:907:8a06:b0:7c1:7b39:faae with SMTP id sc6-20020a1709078a0600b007c17b39faaemr6918979ejc.58.1671740093224; Thu, 22 Dec 2022 12:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671740093; cv=none; d=google.com; s=arc-20160816; b=HSmmDZP6tjU8W2SLiXQFLMvucznbxbE1lwCnhUp5fcrUC2P+MlQ1MPS66pVzTmgTPJ itdaVk3CEbQAS4990wId0AdspH+v/n13Ic9TT/JdYev1a7pedi14KRnhFGO2EiBRLhXM jMNHmM62QkmQcDoNkAlBiNnpebANJbYA3IO8ajO9tqBEY4smPEkPXUXn94fC/idDEW84 JQ1Nfh1xiiUzHxz+DT7I37hyWHcmsCUCps9xxWm9n/JS3NQ/jbSOGePajRgX9aMjin6N 8NwZL/nGCSYLlZwkaJxM4ljSGCesVqw2ieaQx28maRI/RDO+vj4Z/eKQGHzuHRMTRbXK IHLQ== 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-transfer-encoding:mime-version:user-agent:date:to:subject :message-id:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=/D3DjbGuVt4N14gnJNZHEkhQ9cPUUq+1y+iSP+JS5aw=; b=pd3jM3wMyP9ohmBlrAChSO/rm/1zEqjWdjgjCZSgLqmZxEuD8RWJ/81JtrcFLqRzZ6 NDSb3+veJnUvCmYTzzJioQqkMf6YzIMR56bl8ugMXh41ikYJ1AfhQ3aQx3q2ilsnY+cj NaFHhE+9vfsVgKdYq0oJ9AD1mEQr7IiNG0oZ0rKDL+fOENc7Ph/IL8gWyL8YynZjMnTF ZXW5sfi1YOxObg0kUcDin6zhxcHWkNZL7HbFSX8iu7ceOvpW5h5TUp1/R2qYzRRSgcXK v0A/cpsqunlm2IHzzmbANKyyZGO6+DHkSTLM0j//vCc1NvJf2vcc1Q8gPDfL8QHbv76L AK3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VqhzbTYU; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id qf23-20020a1709077f1700b0078db5170767si1238248ejc.18.2022.12.22.12.14.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 12:14:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VqhzbTYU; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 F2297385B50E for ; Thu, 22 Dec 2022 20:14:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2297385B50E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671740092; bh=/D3DjbGuVt4N14gnJNZHEkhQ9cPUUq+1y+iSP+JS5aw=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VqhzbTYUWmU7J2SFVjsbIRYdoNLNGsJWAe2Gt18LRlB7BlQYd5ux1bR4oi8C50cgA 7baJD/d0rTZJ+hHUtiCvpXpZhQuoRAgtrp5bgxJVQmPkKS3eTLOKO1Xt1B+2OdndXV eSRGVd/fFsT7MpMukAo4dVwLqKYmpnhehq3x90Lc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mailrelay.tugraz.at (mailrelay.tugraz.at [129.27.2.202]) by sourceware.org (Postfix) with ESMTPS id 8A8A83858D1E for ; Thu, 22 Dec 2022 20:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A8A83858D1E Received: from [192.168.0.221] (84-115-221-28.cable.dynamic.surfer.at [84.115.221.28]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4NdM2t3jR3z3wj6 for ; Thu, 22 Dec 2022 21:13:58 +0100 (CET) Message-ID: <5791bf0f0ae865ce3479da68fb4cf51b41ddd10d.camel@tugraz.at> Subject: [PATCH] regression tests for 103770 fixed on trunk To: gcc-patches@gcc.gnu.org Date: Thu, 22 Dec 2022 21:13:57 +0100 User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-TUG-Backscatter-control: G/VXY7/6zeyuAY/PU2/0qw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -0.4 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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: Martin Uecker via Gcc-patches From: Martin Uecker Reply-To: Martin Uecker 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?1752946540187444726?= X-GMAIL-MSGID: =?utf-8?q?1752946540187444726?= This adds regression tests for an ICE on valid code that seems gone on trunk, but the cause is still unclear. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103770 regressions tests for PR103770 This adds tests from bugzilla for PR103770 and duplicates. testsuite/gcc.dg/ * pr103770.c: New test. * pr103859.c: New test. * pr105065.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr103770.c b/gcc/testsuite/gcc.dg/pr103770.c new file mode 100644 index 00000000000..f7867d1284c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr103770.c @@ -0,0 +1,27 @@ +/* PR middle-end/103770 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct struct_s { + void* ptr; + void* ptr2; + void* ptr3; +}; + +struct struct_s struct_create(int N, const long vla[N]); + +void fun(int N) +{ + long vla[N]; + struct struct_s st = struct_create(N, vla); +} + + +extern _Complex float g(int N, int dims[N]); + +void f(void) +{ + int dims[1]; + _Complex float val = g(1, dims); +} + diff --git a/gcc/testsuite/gcc.dg/pr103859.c b/gcc/testsuite/gcc.dg/pr103859.c new file mode 100644 index 00000000000..c58be5c15af --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr103859.c @@ -0,0 +1,23 @@ +/* PR middle-end/103859 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typedef struct dcmplx dcmplx; + +struct dcmplx { + double re; + double im; +}; + +dcmplx horner(int n, dcmplx p[n], dcmplx x); + +int main(void) +{ + int i, n; + dcmplx x[n + 1], f[n + 1]; + + horner(n + 1, f, x[i]); + + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/pr105065.c b/gcc/testsuite/gcc.dg/pr105065.c new file mode 100644 index 00000000000..da46d2bb4d8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr105065.c @@ -0,0 +1,16 @@ +/* PR middle-end/105065 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typedef struct +{ + char filler[17]; +} big_struct; + +big_struct dummy(int size, char array[size]); + +int main() +{ + dummy(0, 0); +} +