From patchwork Wed Feb 15 19:19:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 57683 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp373274wrn; Wed, 15 Feb 2023 11:20:46 -0800 (PST) X-Google-Smtp-Source: AK7set+nGvt/aYErWVvCwmYJdXcFVwTnpKViMbIrLp3Vsg5gRuUzxDQn1JbPliMZinMfKUyoUnB5 X-Received: by 2002:a05:6402:2485:b0:4ab:4410:ae1a with SMTP id q5-20020a056402248500b004ab4410ae1amr474202eda.15.1676488846835; Wed, 15 Feb 2023 11:20:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676488846; cv=none; d=google.com; s=arc-20160816; b=FpWxHKV6+0KfJoP8bHoRvC5FIiycx/cxgXYtW0Vs3/B+uAgh6WY2e/sIUal27VN+jN 7s5cHnD9QqIeLjTCVsJQTzTrmkUg3CUBKyC3ij/mj0hjkwtsMFMvIpcONFxXT68f3Fvh ML2zeVh4WJxw2UNFOPUN4QnlghYhcPnKjicZADtSUggWxq03E4urRx/tVQVfcMH3Z0Bk a4ksfEXNoSxhz5gcalXaGLRneZ3kQmotsLXCK0gTnMmWwN0umzWM1mBSuh5SO61ncgeq 1ITx5l8SDrBNWJqWngIRDq8wBA4cfbFsPewIRNOcjZ8am/iMDNlOFbvUTm4S+0vnLbGo CN1Q== 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:date:message-id :content-transfer-encoding:mime-version:subject:cc:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=6SzQuIwuTqIMNCwXWcTEMBZYr8FF3dMtgZTffQrUl4I=; b=d8LToucQMG8dMccHJWVjn/R0aNJmUFQ0EtL2oy7pRYiz5XhWPuzQWtMB4HGjQLImPx 3jk7p8Ckh9tqKTTlppLdiRZ3zkOBo2b8e+1Dpz0lehcF61q1f2YWajfJclg39OPVADL2 0uC9RdKZGJClXU60uzIwsez69kO0BQhfLKEhIZKMniqwvC/cjjiFTUma6vQstjMTZqIx 8fpllb86w/avBJzLYJp/msbDdl2nUQ+nQ3SwyepdyNOhOg3nLb/2WmwYLhJnmsdKiDJo Lc+5909hWxcdl26uAjwrw0Tx9bJ8zaIMV0jb8mxCi7jj49UDBrbnjolOqzDgr4dJiGgU HTSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bmT5Htz7; 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 fb8-20020a1709073a0800b008b14faa2ae0si381672ejc.15.2023.02.15.11.20.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 11:20:46 -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=bmT5Htz7; 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 A2B893858291 for ; Wed, 15 Feb 2023 19:20:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2B893858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676488845; bh=6SzQuIwuTqIMNCwXWcTEMBZYr8FF3dMtgZTffQrUl4I=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=bmT5Htz7G3kharu3mZ/JSJcM7aeBHKKbz/1uj7hNwG0erH7NoxUtZUeCVQIRNgI8a VSx7ta9Q3ZzzZ8aOqPfiFqkZjhn6BpbKHcugkaSqeVXK8gAiLMYVjcOOftI/k/oQ5H ZSKXwYyB0yxpuZixvtU3bGzemAo5+X9Upi/AfHMk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 396A63858D28 for ; Wed, 15 Feb 2023 19:20:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 396A63858D28 To: CC: Subject: [PATCH] testsuite: Handle "packed" targets in c-c++-common/auto-init-7.c and -8.c MIME-Version: 1.0 Message-ID: <20230215191957.F12532042E@pchp3.se.axis.com> Date: Wed, 15 Feb 2023 20:19:57 +0100 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_PASS, 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: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson 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?1757925968664775848?= X-GMAIL-MSGID: =?utf-8?q?1757925968664775848?= Tested for cris-elf. Ok to commit? -- >8 -- Looks like there's a failed assumption that sizeof (union U { char u1[5]; int u2; float u3; }) == 8. However, for "packed" targets like cris-elf, it's 5. These two tests have always failed for cris-elf. I see from https://gcc.gnu.org/pipermail/gcc-testresults/2023-February/777912.html that they fail on pru-elf too, but I don't know if the cause (and/or remedy) is the same. IMHO this is preferred over the alternative; splitting up that last line into two lines, like: /* { dg-final { scan-tree-dump "temp4 = \ .DEFERRED_INIT \\(8, 2, \&\"temp4\"" "gimple" { target { ! default_packed } } } } */ /* { dg-final { scan-tree-dump "temp4 = \ .DEFERRED_INIT \\(5, 2, \&\"temp4\"" "gimple" { target default_packed } } } */ gcc/testsuite: * c-c++-common/auto-init-7.c, c-c++-common/auto-init-8.c: Also match targets where sizeof (union U) == 5, like "packed" targets. --- gcc/testsuite/c-c++-common/auto-init-7.c | 2 +- gcc/testsuite/c-c++-common/auto-init-8.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/c-c++-common/auto-init-7.c b/gcc/testsuite/c-c++-common/auto-init-7.c index b44dd5e68ed1..dd48d691596f 100644 --- a/gcc/testsuite/c-c++-common/auto-init-7.c +++ b/gcc/testsuite/c-c++-common/auto-init-7.c @@ -32,4 +32,4 @@ double foo() /* { dg-final { scan-tree-dump "temp1 = .DEFERRED_INIT \\(12, 2, \&\"temp1\"" "gimple" } } */ /* { dg-final { scan-tree-dump "temp2 = .DEFERRED_INIT \\(24, 2, \&\"temp2\"" "gimple" } } */ /* { dg-final { scan-tree-dump "temp3 = .DEFERRED_INIT \\(28, 2, \&\"temp3\"" "gimple" } } */ -/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\(8, 2, \&\"temp4\"" "gimple" } } */ +/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\((8|5), 2, \&\"temp4\"" "gimple" } } */ diff --git a/gcc/testsuite/c-c++-common/auto-init-8.c b/gcc/testsuite/c-c++-common/auto-init-8.c index 739ac0289315..863f2ba87d7d 100644 --- a/gcc/testsuite/c-c++-common/auto-init-8.c +++ b/gcc/testsuite/c-c++-common/auto-init-8.c @@ -32,4 +32,4 @@ double foo() /* { dg-final { scan-tree-dump "temp1 = .DEFERRED_INIT \\(12, 1, \&\"temp1\"" "gimple" } } */ /* { dg-final { scan-tree-dump "temp2 = .DEFERRED_INIT \\(24, 1, \&\"temp2\"" "gimple" } } */ /* { dg-final { scan-tree-dump "temp3 = .DEFERRED_INIT \\(28, 1, \&\"temp3\"" "gimple" } } */ -/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\(8, 1, \&\"temp4\"" "gimple" } } */ +/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\((8|5), 1, \&\"temp4\"" "gimple" } } */