From patchwork Tue May 3 19:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 53432 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BEF6B396D811 for ; Tue, 3 May 2022 19:02:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id E7857395B455 for ; Tue, 3 May 2022 19:00:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7857395B455 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Zs8bLOI245hE/9R6h8tRylg04bOIB1Mbdd1nBAejTf0=; b=tSRwT6M6jASrUYtar3Uh/c6cRy cGvl1rhKwPINj6ZRxvigrKEdWdOm8PBx9bDh0vZu3u6dp+aglRNIuXmBdbE0xASxOAJtFWYmT590v YmzRTKJaJLqwRj8IdgWPjInfH8HcqP9sgNire4TiuoOmPP3VEOK5q1t9WOakLNedoooVRmtzFiHvx F59ZgRqM4N41OkDDSHHPCvDBn7ehVwxJo6TDIvt6pH4h3bW5n1s6sC7IVDTQlhov7h6HNvqdHEgbe ydTDFvqamBqLsFPwF2UMpmoA7HxjKsYQm17rYen6TfMAgmsaXUPXcx7/Th8ZaFjUPDMCWfYMJv3F9 at0Vu/zQ==; Received: from [95.87.234.74] (port=46810 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nlxlF-000BL3-4f; Tue, 03 May 2022 22:00:39 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH][committed] testsuite: Skip cases for default_packed targets Date: Tue, 3 May 2022 22:00:14 +0300 Message-Id: <20220503190015.300440-4-dimitar@dinux.eu> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HAS_X_OUTGOING_SPAM_STAT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The memchr test cases expect padding to be present in structures. But this is not true for targets which pack by default. Skip these test cases in order to avoid static assert errors when checking field offsets. The following asserts are triggered due to assumptions for structure field alignment: memcmp-3.c: _Static_assert (sizeof (struct S8_16_32) == 8); memchr.c: _Static_assert (__builtin_offsetof (struct SX, a) == 6); Committed as obvious. gcc/testsuite/ChangeLog: * gcc.dg/memchr.c: Skip for default_packed targets. * gcc.dg/memcmp-3.c: Ditto. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.dg/memchr.c | 3 ++- gcc/testsuite/gcc.dg/memcmp-3.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/memchr.c b/gcc/testsuite/gcc.dg/memchr.c index fb21d58b476..27524b82520 100644 --- a/gcc/testsuite/gcc.dg/memchr.c +++ b/gcc/testsuite/gcc.dg/memchr.c @@ -1,6 +1,7 @@ /* PR middle-end/78257 - missing memcmp optimization with constant arrays { dg-do compile } - { dg-options "-O -Wall -fdump-tree-optimized" } */ + { dg-options "-O -Wall -fdump-tree-optimized" } + { dg-skip-if "test assumes structs are not packed" { default_packed } } */ typedef __INT8_TYPE__ int8_t; typedef __INT16_TYPE__ int16_t; diff --git a/gcc/testsuite/gcc.dg/memcmp-3.c b/gcc/testsuite/gcc.dg/memcmp-3.c index b5b8ac1209f..8ddde996c2f 100644 --- a/gcc/testsuite/gcc.dg/memcmp-3.c +++ b/gcc/testsuite/gcc.dg/memcmp-3.c @@ -1,7 +1,8 @@ /* PR middle-end/78257 - missing memcmp optimization with constant arrays { dg-do compile } { dg-options "-O -Wall -fdump-tree-optimized" } - { dg-skip-if "missing data representation" { "pdp11-*-*" } } */ + { dg-skip-if "missing data representation" { "pdp11-*-*" } } + { dg-skip-if "test assumes structs are not packed" { default_packed } } */ #define offsetof(T, m) __builtin_offsetof (T, m)