From patchwork Mon Jul 20 16:31:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1332487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=nhSQh6qU; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9S0n1KmGzB3td for ; Tue, 21 Jul 2020 02:31:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BBFCC3861031; Mon, 20 Jul 2020 16:31:32 +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 A30D6386184F for ; Mon, 20 Jul 2020 16:31:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A30D6386184F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@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:References:In-Reply-To: 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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=utzuXpzZnu8Dmm6o21Q20nwxHDqyqol1RZ5mh22eg6I=; b=nhSQh6qUhTxnOxJQ63k30CgLdJ ax4/Q9J06nYydFlxMBiovYGOQ0MmSOn0F90Iy0HWH0XRrb+YcC0YlHb4KucgE3HeUOwXEu9OfeU/t ZLSfRfDbauIfAGqCfF7jq2elYmzyHRsRBCozSNL38fnR2HyRHQsAR2Fh+N+BFR+jHmV/h5juZB8tE XrK5gOp/t/ioDN4+ylmoTT8MeQBeiIgLq2wQ5bbqjN2vUMfIIJKRk3BAGVB8I+dt5SzDKaJ7iNrCL HEBLXFXAOjsj0er1PWrKxj0VRN+xp9+GAvR8qGSSJscn04QygDYTxc2QJbWh+juUMPzpbhumVI2+9 WLKumVpA==; Received: from [95.87.234.74] (port=60198 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jxYhG-00046m-45; Mon, 20 Jul 2020 19:31:25 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/4] testsuite: Filter unaligned pointer value warning Date: Mon, 20 Jul 2020 19:31:03 +0300 Message-Id: <20200720163106.27849-2-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200720163106.27849-1-dimitar@dinux.eu> References: <20200720163106.27849-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 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=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Targets which pack structures by default will not get warnings about unaligned access to structure members. gcc/testsuite/ChangeLog: * c-c++-common/Waddress-of-packed-member-1.c: Filter dg-warning for targets who pack by default. * c-c++-common/Waddress-of-packed-member-2.c: Ditto. * c-c++-common/pr51628-13.c: Ditto. * c-c++-common/pr51628-15.c: Ditto. * c-c++-common/pr51628-16.c: Ditto. * c-c++-common/pr51628-26.c: Ditto. * c-c++-common/pr51628-27.c: Ditto. * c-c++-common/pr51628-28.c: Ditto. * c-c++-common/pr51628-29.c: Ditto. * c-c++-common/pr51628-3.c: Ditto. * c-c++-common/pr51628-30.c: Ditto. * c-c++-common/pr51628-31.c: Ditto. * c-c++-common/pr51628-32.c: Ditto. * c-c++-common/pr51628-33.c: Ditto. * c-c++-common/pr51628-35.c: Ditto. * c-c++-common/pr51628-4.c: Ditto. * c-c++-common/pr51628-5.c: Ditto. * c-c++-common/pr51628-6.c: Ditto. * c-c++-common/pr51628-8.c: Ditto. * c-c++-common/pr51628-9.c: Ditto. * c-c++-common/pr88664-2.c: Ditto. * gcc.dg/pr51628-17.c: Ditto. * gcc.dg/pr51628-19.c: Ditto. * gcc.dg/pr51628-20.c: Ditto. * gcc.dg/pr51628-21.c: Ditto. * gcc.dg/pr51628-22.c: Ditto. * gcc.dg/pr51628-24.c: Ditto. * gcc.dg/pr51628-25.c: Ditto. * gcc.dg/pr51628-34.c: Ditto. * gcc.dg/pr88928.c: Ditto. Signed-off-by: Dimitar Dimitrov --- .../Waddress-of-packed-member-1.c | 48 +++++++++---------- .../Waddress-of-packed-member-2.c | 36 +++++++------- gcc/testsuite/c-c++-common/pr51628-13.c | 2 +- gcc/testsuite/c-c++-common/pr51628-15.c | 2 +- gcc/testsuite/c-c++-common/pr51628-16.c | 4 +- gcc/testsuite/c-c++-common/pr51628-26.c | 6 +-- gcc/testsuite/c-c++-common/pr51628-27.c | 2 +- gcc/testsuite/c-c++-common/pr51628-28.c | 10 ++-- gcc/testsuite/c-c++-common/pr51628-29.c | 2 +- gcc/testsuite/c-c++-common/pr51628-3.c | 12 ++--- gcc/testsuite/c-c++-common/pr51628-30.c | 4 +- gcc/testsuite/c-c++-common/pr51628-31.c | 2 +- gcc/testsuite/c-c++-common/pr51628-32.c | 2 +- gcc/testsuite/c-c++-common/pr51628-33.c | 2 +- gcc/testsuite/c-c++-common/pr51628-35.c | 4 +- gcc/testsuite/c-c++-common/pr51628-4.c | 12 ++--- gcc/testsuite/c-c++-common/pr51628-5.c | 12 ++--- gcc/testsuite/c-c++-common/pr51628-6.c | 12 ++--- gcc/testsuite/c-c++-common/pr51628-8.c | 14 +++--- gcc/testsuite/c-c++-common/pr51628-9.c | 14 +++--- gcc/testsuite/c-c++-common/pr88664-2.c | 4 +- gcc/testsuite/gcc.dg/pr51628-17.c | 2 +- gcc/testsuite/gcc.dg/pr51628-19.c | 6 +-- gcc/testsuite/gcc.dg/pr51628-20.c | 2 +- gcc/testsuite/gcc.dg/pr51628-21.c | 2 +- gcc/testsuite/gcc.dg/pr51628-22.c | 2 +- gcc/testsuite/gcc.dg/pr51628-24.c | 2 +- gcc/testsuite/gcc.dg/pr51628-25.c | 2 +- gcc/testsuite/gcc.dg/pr51628-34.c | 8 ++-- gcc/testsuite/gcc.dg/pr88928.c | 2 +- 30 files changed, 117 insertions(+), 117 deletions(-) diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c index afad603dfa2..95a376664da 100644 --- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c +++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c @@ -52,28 +52,28 @@ void foo (void) f0 = *&__real__ t0.f; /* { dg-bogus "may result in an unaligned pointer value" } */ f0 = *&__imag__ t0.f; /* { dg-bogus "may result in an unaligned pointer value" } */ i1 = (&t0.c, (int*) 0); /* { dg-bogus "may result in an unaligned pointer value" } */ - t2 = (struct t**) t10; /* { dg-warning "may result in an unaligned pointer value" } */ - t2 = (struct t**) t100; /* { dg-warning "may result in an unaligned pointer value" } */ - t2 = (struct t**) t1; /* { dg-warning "may result in an unaligned pointer value" } */ - t2 = (struct t**) bar(); /* { dg-warning "may result in an unaligned pointer value" } */ - t2 = (struct t**) baz(); /* { dg-warning "may result in an unaligned pointer value" } */ - t2 = (struct t**) bazz(); /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = &t0.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = &t1->b; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = &t10[0].b; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = t0.d; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = t1->d; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = t10[0].d; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (int*) &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (int*) t10[0].e; /* { dg-warning "may result in an unaligned pointer value" } */ - i2 = &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i2 = t10[0].e; /* { dg-warning "may result in an unaligned pointer value" } */ - i2 = &*&t0.c; /* { dg-warning "may result in an unaligned pointer value" } */ - i2 = &*&*&t0.c; /* { dg-warning "may result in an unaligned pointer value" } */ - f1 = &__real__ t0.f; /* { dg-warning "may result in an unaligned pointer value" } */ - f1 = &__imag__ t0.f; /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (0, (int*) &t0.c); /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (int*) (0, &t0.c); /* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" } */ - i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" } */ + t2 = (struct t**) t10; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + t2 = (struct t**) t100; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + t2 = (struct t**) t1; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + t2 = (struct t**) bar(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + t2 = (struct t**) baz(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + t2 = (struct t**) bazz(); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = &t0.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = &t1->b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = &t10[0].b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = t0.d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = t1->d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = t10[0].d; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (int*) &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (int*) t10[0].e; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i2 = &t10[0].e[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i2 = t10[0].e; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i2 = &*&t0.c; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i2 = &*&*&t0.c; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + f1 = &__real__ t0.f; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + f1 = &__imag__ t0.f; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (0, (int*) &t0.c); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (int*) (0, &t0.c); /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ } diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c index 65ec5140c9c..5dbcb89ffbc 100644 --- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c +++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c @@ -24,24 +24,24 @@ int *i0; void foo (void) { - i0 = s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = s0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = t0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &s0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &t0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &s0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &t0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = *s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = *t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &**s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &**t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = **&s0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = **&t0.p.b; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &*s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = &*t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = *&s0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ - i0 = *&t0.p.a; /* { dg-warning "may result in an unaligned pointer value" } */ + i0 = s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = s0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = t0.p.b[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &s0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &t0.p.a[0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &s0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &t0.p.b[0][0]; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = *s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = *t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &**s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &**t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = **&s0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = **&t0.p.b; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &*s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = &*t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = *&s0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ + i0 = *&t0.p.a; /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } } */ i0 = t0.u.a; /* { dg-bogus "may result in an unaligned pointer value" } */ i0 = t0.u.b[0]; /* { dg-bogus "may result in an unaligned pointer value" } */ i0 = &t0.u.a[0]; /* { dg-bogus "may result in an unaligned pointer value" } */ diff --git a/gcc/testsuite/c-c++-common/pr51628-13.c b/gcc/testsuite/c-c++-common/pr51628-13.c index 0edd5e7f84d..b77e16c408f 100644 --- a/gcc/testsuite/c-c++-common/pr51628-13.c +++ b/gcc/testsuite/c-c++-common/pr51628-13.c @@ -6,4 +6,4 @@ struct B { int i; }; struct C { struct B b; } __attribute__ ((packed)); int* h4 (struct C *p) { return &p->b.i; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/pr51628-15.c b/gcc/testsuite/c-c++-common/pr51628-15.c index bcac6d70ad5..2ce3406481f 100644 --- a/gcc/testsuite/c-c++-common/pr51628-15.c +++ b/gcc/testsuite/c-c++-common/pr51628-15.c @@ -10,5 +10,5 @@ int* f (struct A *p, int *q) { return q ? q : &p->i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-16.c b/gcc/testsuite/c-c++-common/pr51628-16.c index cd502fe76b8..b02cd8df1fc 100644 --- a/gcc/testsuite/c-c++-common/pr51628-16.c +++ b/gcc/testsuite/c-c++-common/pr51628-16.c @@ -8,6 +8,6 @@ struct B { } b; int *p = (int*)&b.a.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int *q = (int*)&b.a; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/pr51628-26.c b/gcc/testsuite/c-c++-common/pr51628-26.c index 2042379860a..5ca381dba5d 100644 --- a/gcc/testsuite/c-c++-common/pr51628-26.c +++ b/gcc/testsuite/c-c++-common/pr51628-26.c @@ -15,19 +15,19 @@ void foo1 (void) { addr = (i = -1, &p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } void foo2 (void) { addr = (i = -1, j = -2, &p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } void foo3 (void) { addr = (i = -1, (j = -2, &p.i)); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-27.c b/gcc/testsuite/c-c++-common/pr51628-27.c index 9ae1efd7afb..016a68f6549 100644 --- a/gcc/testsuite/c-c++-common/pr51628-27.c +++ b/gcc/testsuite/c-c++-common/pr51628-27.c @@ -9,4 +9,4 @@ struct C { struct B b; }; extern struct C *p; int* g8 (void) { return &p->b.a.i; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/pr51628-28.c b/gcc/testsuite/c-c++-common/pr51628-28.c index 3cc1fec1f71..80d0c605670 100644 --- a/gcc/testsuite/c-c++-common/pr51628-28.c +++ b/gcc/testsuite/c-c++-common/pr51628-28.c @@ -11,9 +11,9 @@ foo3 (struct A *p1, int *q1, int *q2, struct A *p2) { return (q1 ? &p1->i -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ : (q2 ? &p2->i : q2)); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } int* @@ -21,11 +21,11 @@ foo4 (struct A *p1, int **q1, int *q2, int *q3, struct A *p2) { return (q1 ? (*q1 = q2, &p1->i) -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ : (q2 ? (*q1 = &p1->i, -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ *q2 = 2, &p2->i) -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ : q2)); } diff --git a/gcc/testsuite/c-c++-common/pr51628-29.c b/gcc/testsuite/c-c++-common/pr51628-29.c index 94b3722d2c8..a3e77455b6b 100644 --- a/gcc/testsuite/c-c++-common/pr51628-29.c +++ b/gcc/testsuite/c-c++-common/pr51628-29.c @@ -12,5 +12,5 @@ int* g8 (void) { return &p->b.a.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-3.c b/gcc/testsuite/c-c++-common/pr51628-3.c index 0ea94c845a0..805ce7d0509 100644 --- a/gcc/testsuite/c-c++-common/pr51628-3.c +++ b/gcc/testsuite/c-c++-common/pr51628-3.c @@ -13,7 +13,7 @@ extern int *x; extern void bar (int *); int *addr = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (void) @@ -21,15 +21,15 @@ foo (void) struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } }; int *p0, *p1; p0 = &arr[0].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &arr[1].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (&p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-30.c b/gcc/testsuite/c-c++-common/pr51628-30.c index 578edf4e8f9..b31e73ec036 100644 --- a/gcc/testsuite/c-c++-common/pr51628-30.c +++ b/gcc/testsuite/c-c++-common/pr51628-30.c @@ -12,12 +12,12 @@ int* foo1 (void) { return &__real(p->b.a.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } int* foo2 (void) { return &__imag(p->b.a.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-31.c b/gcc/testsuite/c-c++-common/pr51628-31.c index 9730f53f582..b2963581dcb 100644 --- a/gcc/testsuite/c-c++-common/pr51628-31.c +++ b/gcc/testsuite/c-c++-common/pr51628-31.c @@ -12,5 +12,5 @@ int * foo() { return &x.x[1]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-32.c b/gcc/testsuite/c-c++-common/pr51628-32.c index a62e57d5b46..52f5e543ab7 100644 --- a/gcc/testsuite/c-c++-common/pr51628-32.c +++ b/gcc/testsuite/c-c++-common/pr51628-32.c @@ -16,4 +16,4 @@ struct B struct B b; int *p = &b.ar[1].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/c-c++-common/pr51628-33.c b/gcc/testsuite/c-c++-common/pr51628-33.c index 0092f32202f..6b5e277b7c6 100644 --- a/gcc/testsuite/c-c++-common/pr51628-33.c +++ b/gcc/testsuite/c-c++-common/pr51628-33.c @@ -15,5 +15,5 @@ void foo (struct pair_t *p) { bar (p ? p->i : (int *) 0); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-35.c b/gcc/testsuite/c-c++-common/pr51628-35.c index 20877792fd8..fa37d99beb7 100644 --- a/gcc/testsuite/c-c++-common/pr51628-35.c +++ b/gcc/testsuite/c-c++-common/pr51628-35.c @@ -12,12 +12,12 @@ long * foo1 (void) { return (long *) p; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } long * foo2 (void) { return (long *) bar (); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-4.c b/gcc/testsuite/c-c++-common/pr51628-4.c index c4c1fb72d6d..ba88f5d0a39 100644 --- a/gcc/testsuite/c-c++-common/pr51628-4.c +++ b/gcc/testsuite/c-c++-common/pr51628-4.c @@ -13,7 +13,7 @@ extern int *x; extern void bar (int *); int *addr = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (void) @@ -21,15 +21,15 @@ foo (void) struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } }; int *p0, *p1; p0 = &arr[0].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &arr[1].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (&p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-5.c b/gcc/testsuite/c-c++-common/pr51628-5.c index 9d7c309a0ef..86d01e9f3b3 100644 --- a/gcc/testsuite/c-c++-common/pr51628-5.c +++ b/gcc/testsuite/c-c++-common/pr51628-5.c @@ -13,7 +13,7 @@ extern int *x; extern void bar (int *); int *addr = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (void) @@ -21,15 +21,15 @@ foo (void) struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } }; int *p0, *p1; p0 = &arr[0].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &arr[1].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (&p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-6.c b/gcc/testsuite/c-c++-common/pr51628-6.c index 52aa07a4cf3..e7be7fbffc5 100644 --- a/gcc/testsuite/c-c++-common/pr51628-6.c +++ b/gcc/testsuite/c-c++-common/pr51628-6.c @@ -13,7 +13,7 @@ extern int *x; extern void bar (int *); int *addr = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (void) @@ -21,15 +21,15 @@ foo (void) struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } }; int *p0, *p1; p0 = &arr[0].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &arr[1].i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (&p.i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-8.c b/gcc/testsuite/c-c++-common/pr51628-8.c index cc2dae096ae..dd4f1904c11 100644 --- a/gcc/testsuite/c-c++-common/pr51628-8.c +++ b/gcc/testsuite/c-c++-common/pr51628-8.c @@ -13,24 +13,24 @@ extern int *x; extern void bar (int *); int *addr = p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (struct pair_t *p) { int *p0, *p1; p0 = p->i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &p->i[1]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (p->i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (&p->i[2]); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = p->i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p->i[3]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr51628-9.c b/gcc/testsuite/c-c++-common/pr51628-9.c index 0470aa3b93d..aa3d5292d43 100644 --- a/gcc/testsuite/c-c++-common/pr51628-9.c +++ b/gcc/testsuite/c-c++-common/pr51628-9.c @@ -13,24 +13,24 @@ extern int *x; extern void bar (int *); int *addr = p.i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ int * foo (struct pair_t *p) { int *p0, *p1; p0 = p->i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p0); p1 = &p->i[1]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (p1); bar (p->i); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ bar (&p->i[2]); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ x = p->i; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ return &p->i[3]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/c-c++-common/pr88664-2.c b/gcc/testsuite/c-c++-common/pr88664-2.c index d2d880a66d7..9a81b751802 100644 --- a/gcc/testsuite/c-c++-common/pr88664-2.c +++ b/gcc/testsuite/c-c++-common/pr88664-2.c @@ -11,12 +11,12 @@ void ** fun1 (struct data *p) { return &p->ptr; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } int * fun2 (struct data *p, int *x) { return p ? (*x = 1, (int *) &p->ptr) : (int *) 0; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/pr51628-17.c b/gcc/testsuite/gcc.dg/pr51628-17.c index 0be95b2294e..42dc9d745dc 100644 --- a/gcc/testsuite/gcc.dg/pr51628-17.c +++ b/gcc/testsuite/gcc.dg/pr51628-17.c @@ -7,4 +7,4 @@ struct A { } __attribute__ ((packed)); long* f8 (struct A *p) { return &p->i; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-19.c b/gcc/testsuite/gcc.dg/pr51628-19.c index 7ff03e85cea..91ff39abc88 100644 --- a/gcc/testsuite/gcc.dg/pr51628-19.c +++ b/gcc/testsuite/gcc.dg/pr51628-19.c @@ -16,11 +16,11 @@ bar (int n, int k, void *ptr) int *p0, *p1; p0 = p->x; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ foo (p0); p1 = &p->x[1]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ foo (p1); return &p->x[1]; -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/pr51628-20.c b/gcc/testsuite/gcc.dg/pr51628-20.c index bcdbff1e554..2249d85098b 100644 --- a/gcc/testsuite/gcc.dg/pr51628-20.c +++ b/gcc/testsuite/gcc.dg/pr51628-20.c @@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed)); extern struct C *p; long* g8 (void) { return p; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-21.c b/gcc/testsuite/gcc.dg/pr51628-21.c index 0c7fab75d8a..f1adbe64002 100644 --- a/gcc/testsuite/gcc.dg/pr51628-21.c +++ b/gcc/testsuite/gcc.dg/pr51628-21.c @@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed)); extern struct C p[]; long* g8 (void) { return p; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-22.c b/gcc/testsuite/gcc.dg/pr51628-22.c index 1bd5d791639..25ac36cf0a2 100644 --- a/gcc/testsuite/gcc.dg/pr51628-22.c +++ b/gcc/testsuite/gcc.dg/pr51628-22.c @@ -6,4 +6,4 @@ struct B { int i; }; struct C { struct B b; } __attribute__ ((packed)); int* g4 (struct C *p) { return &p->b; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-24.c b/gcc/testsuite/gcc.dg/pr51628-24.c index 3ad99cd2f16..1e454a1dc0e 100644 --- a/gcc/testsuite/gcc.dg/pr51628-24.c +++ b/gcc/testsuite/gcc.dg/pr51628-24.c @@ -7,4 +7,4 @@ struct A { } __attribute__ ((packed)); short* f2 (struct A *p) { return &p->i; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-25.c b/gcc/testsuite/gcc.dg/pr51628-25.c index 94a3a8fbaf2..f00d9b1bcac 100644 --- a/gcc/testsuite/gcc.dg/pr51628-25.c +++ b/gcc/testsuite/gcc.dg/pr51628-25.c @@ -6,4 +6,4 @@ struct B { int i; }; struct C { struct B b; } __attribute__ ((packed)); long* g8 (struct C *p) { return p; } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ diff --git a/gcc/testsuite/gcc.dg/pr51628-34.c b/gcc/testsuite/gcc.dg/pr51628-34.c index 51d4b26a114..0f6ae34fb96 100644 --- a/gcc/testsuite/gcc.dg/pr51628-34.c +++ b/gcc/testsuite/gcc.dg/pr51628-34.c @@ -9,9 +9,9 @@ baz (int x, struct S *p) { return (x ? &p->a -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ : &p->b); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } short * @@ -19,7 +19,7 @@ qux (int x, struct S *p) { return (short *) (x ? &p->a -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ : &p->b); -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ } diff --git a/gcc/testsuite/gcc.dg/pr88928.c b/gcc/testsuite/gcc.dg/pr88928.c index c0a1f766cb0..0b6c1d70f05 100644 --- a/gcc/testsuite/gcc.dg/pr88928.c +++ b/gcc/testsuite/gcc.dg/pr88928.c @@ -3,4 +3,4 @@ struct a { } __attribute__((__packed__)); void c (struct a **); void d (const struct a *b) { c ((struct a **) b); } -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */ +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */ From patchwork Mon Jul 20 16:31:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1332488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=eJjJfJHS; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9S0s1WT1zB3tg for ; Tue, 21 Jul 2020 02:31:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B5CF3861854; Mon, 20 Jul 2020 16:31:33 +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 19CCC3861031 for ; Mon, 20 Jul 2020 16:31:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 19CCC3861031 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@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:References:In-Reply-To: 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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+TXsBBskbSm4kCzlLeryCwIq0K1OTSqbZkkxeWOonm4=; b=eJjJfJHS6FMS6HC+7s6dZKnVP3 WZDjAw9DoHqp6JdSnfiEWv0Ut9Ia0I6kNWwJ/XwzD+1gW8xbKQZ68vyII5WOCdk9qvpvtCEFo7XZH geH4NjHcH0XLZx5PhKFgiBfgcuZvz/lhoir3jDhoLfTSyrz33vkBWcOKkavDNBF+lAW1rr7NUXLMQ MI7z8cb7ehTi3vBTUvW4lcJaUdocsvf21v35b9rg3B8ZJ0wG5cojjcBtI//0UvRPUvrkraqkI+U9J 7InZAcIKkMmOOnLG1spfz7wQEv/dsOI8vrzSkTwR5SspS+HEZe/BibmKuiR+BhbEYIpliCyhOQRR2 iDcS2ODg==; Received: from [95.87.234.74] (port=60198 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jxYhJ-00046m-JI; Mon, 20 Jul 2020 19:31:28 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/4] testsuite: Add expected warning for packed attribute Date: Mon, 20 Jul 2020 19:31:04 +0300 Message-Id: <20200720163106.27849-3-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200720163106.27849-1-dimitar@dinux.eu> References: <20200720163106.27849-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 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=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Targets which pack structures by default get warnings for packed structure attributes. This is expected, so add markers in the test cases. gcc/testsuite/ChangeLog: * c-c++-common/Waddress-of-packed-member-2.c: Add dg-warning for ignored attribute if target is default_packed. * c-c++-common/Wattributes.c: Ditto. * c-c++-common/attr-copy.c: Ditto. * c-c++-common/builtin-has-attribute-4.c: Ditto. * c-c++-common/pr51628-29.c: Ditto. * c-c++-common/pr51628-30.c: Ditto. * c-c++-common/pr51628-32.c: Ditto. * gcc.dg/Wattributes-6.c: Ditto. * gcc.dg/attr-copy-4.c: Ditto. * gcc.dg/attr-copy-8.c: Ditto. Signed-off-by: Dimitar Dimitrov --- .../Waddress-of-packed-member-2.c | 1 + gcc/testsuite/c-c++-common/Wattributes.c | 2 +- gcc/testsuite/c-c++-common/attr-copy.c | 1 + .../c-c++-common/builtin-has-attribute-4.c | 2 +- gcc/testsuite/c-c++-common/pr51628-29.c | 1 + gcc/testsuite/c-c++-common/pr51628-30.c | 1 + gcc/testsuite/c-c++-common/pr51628-32.c | 1 + gcc/testsuite/gcc.dg/Wattributes-6.c | 2 +- gcc/testsuite/gcc.dg/attr-copy-4.c | 3 ++- gcc/testsuite/gcc.dg/attr-copy-8.c | 25 +++++++++++++++++++ 10 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c index 5dbcb89ffbc..802dd8156cb 100644 --- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c +++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c @@ -15,6 +15,7 @@ struct s { struct t { char c; struct r p __attribute__((packed)); + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ struct r u; }; diff --git a/gcc/testsuite/c-c++-common/Wattributes.c b/gcc/testsuite/c-c++-common/Wattributes.c index 3f176a04660..4ad90441b4d 100644 --- a/gcc/testsuite/c-c++-common/Wattributes.c +++ b/gcc/testsuite/c-c++-common/Wattributes.c @@ -21,7 +21,7 @@ PackedAligned { int i; }; struct ATTR ((aligned (2))) AlignedMemberPacked { - int ATTR ((packed)) i; + int ATTR ((packed)) i; // { dg-warning "attribute ignored" "" { target default_packed } } }; struct ATTR ((packed)) diff --git a/gcc/testsuite/c-c++-common/attr-copy.c b/gcc/testsuite/c-c++-common/attr-copy.c index 284088a8b97..f0db0fd1a27 100644 --- a/gcc/testsuite/c-c++-common/attr-copy.c +++ b/gcc/testsuite/c-c++-common/attr-copy.c @@ -21,6 +21,7 @@ struct C { char c; ATTR (copy ((bar (), ((struct A *)(0))[0]))) int i; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ }; /* Verify the attribute has been copied. */ diff --git a/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c b/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c index ec3127794b5..3a960aae2ff 100644 --- a/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c +++ b/gcc/testsuite/c-c++-common/builtin-has-attribute-4.c @@ -130,7 +130,7 @@ struct PackedMember char c; short s; int i; - ATTR (packed) int a[2]; + ATTR (packed) int a[2]; /* { dg-warning "attribute ignored" "" { target default_packed } } */ } gpak[2]; void test_packed (struct PackedMember *p) diff --git a/gcc/testsuite/c-c++-common/pr51628-29.c b/gcc/testsuite/c-c++-common/pr51628-29.c index a3e77455b6b..1ad9a7d2d9f 100644 --- a/gcc/testsuite/c-c++-common/pr51628-29.c +++ b/gcc/testsuite/c-c++-common/pr51628-29.c @@ -5,6 +5,7 @@ struct A { int i; }; struct B { struct A a; }; struct C { struct B b __attribute__ ((packed)); }; +/* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ extern struct C *p; diff --git a/gcc/testsuite/c-c++-common/pr51628-30.c b/gcc/testsuite/c-c++-common/pr51628-30.c index b31e73ec036..387fc71db13 100644 --- a/gcc/testsuite/c-c++-common/pr51628-30.c +++ b/gcc/testsuite/c-c++-common/pr51628-30.c @@ -5,6 +5,7 @@ struct A { __complex int i; }; struct B { struct A a; }; struct C { struct B b __attribute__ ((packed)); }; +/* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ extern struct C *p; diff --git a/gcc/testsuite/c-c++-common/pr51628-32.c b/gcc/testsuite/c-c++-common/pr51628-32.c index 52f5e543ab7..908c0b8cbf4 100644 --- a/gcc/testsuite/c-c++-common/pr51628-32.c +++ b/gcc/testsuite/c-c++-common/pr51628-32.c @@ -11,6 +11,7 @@ struct B { char c; __attribute ((packed)) struct A ar[4]; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ }; struct B b; diff --git a/gcc/testsuite/gcc.dg/Wattributes-6.c b/gcc/testsuite/gcc.dg/Wattributes-6.c index d3dd22d85b9..4ba59bf2806 100644 --- a/gcc/testsuite/gcc.dg/Wattributes-6.c +++ b/gcc/testsuite/gcc.dg/Wattributes-6.c @@ -21,7 +21,7 @@ PackedAligned { int i; }; struct ATTR ((aligned (2))) AlignedMemberPacked { - int ATTR ((packed)) i; + int ATTR ((packed)) i; // { dg-warning "attribute ignored" "" { target default_packed } } }; struct ATTR ((packed)) diff --git a/gcc/testsuite/gcc.dg/attr-copy-4.c b/gcc/testsuite/gcc.dg/attr-copy-4.c index 1350a35ec94..796724bb950 100644 --- a/gcc/testsuite/gcc.dg/attr-copy-4.c +++ b/gcc/testsuite/gcc.dg/attr-copy-4.c @@ -21,7 +21,8 @@ Assert (__alignof (struct PackedA) == __alignof (struct PackedB)); struct PackedMember { char c; - ATTR ((copy ((struct PackedB*)0))) double packed_mem; + ATTR ((copy ((struct PackedB*)0))) double packed_mem; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ }; Assert (__alignof (struct PackedMember) == 1); diff --git a/gcc/testsuite/gcc.dg/attr-copy-8.c b/gcc/testsuite/gcc.dg/attr-copy-8.c index c75d9e5c98c..7195f6b19f8 100644 --- a/gcc/testsuite/gcc.dg/attr-copy-8.c +++ b/gcc/testsuite/gcc.dg/attr-copy-8.c @@ -21,41 +21,66 @@ extern B *pb; typedef struct C { ATTR (copy ((struct A *)0)) short m_pa_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy ((struct A *)(1, 0))) int m_pa_1_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy ((struct A *)(0, 1))) long m_pa_0_1; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*(struct A *)0)) short m_xpa_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*(struct A *)(1, 0))) int m_xpa_1_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*(struct A *)(0, 1))) long m_xpa_0_1; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (((struct A *)0)[0])) short m_arpa_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (((struct A *)(1, 0))[0])) int m_arpa_1_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (((struct A *)(0, 1))[0])) long m_arpa_0_1; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ /* Also exercise COMPONENT_REF, ARRAY_REF, and INDIRECT_REF. */ ATTR (copy (a)) short m_ra; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (b.a)) int m_rb_a; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (b.pa)) long m_rb_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (&a)) short m_ara; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (&b.a)) int m_arb_a; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*b.pa)) long m_xb_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (b.pa[0])) long m_arb_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*pa)) short m_xpa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (pa[0])) short m_arpa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (ab[0].a)) int m_arab_a; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (ab[1].pa)) long m_arab_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*ab[2].pa)) int m_xarab_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (ab[3].pa->bf)) unsigned int m_arab_pa_bf: 1; ATTR (copy (pb->a)) int m_pb_a; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (pb->pa)) long m_pb_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (*pb->pa)) int m_xpb_pa; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ ATTR (copy (pb->pa->bf)) unsigned int m_pb_pa_bf: 1; ATTR (aligned (4), copy ((struct A *)(0))) short m_a4_pa_0; + /* { dg-warning "attribute ignored" "" { target default_packed } .-1 } */ } C; From patchwork Mon Jul 20 16:31:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1332489 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=OI/iqMxj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9S0z2d3SzB3th for ; Tue, 21 Jul 2020 02:31:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15BBB3861893; Mon, 20 Jul 2020 16:31:35 +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 4CB943851C39 for ; Mon, 20 Jul 2020 16:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4CB943851C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@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:References:In-Reply-To: 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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7NAGhPSKW3TFz+MXGDW4uCwaXZUEvFrHrcSR8h8MnU0=; b=OI/iqMxjUW8fCoK3VAXo83HUmn k9Tm8qw2FW0Q4cp5HCgE7t2mA2kCdx9jpskVANBxCRphF9Lc2mNwJDY+1zHH27LF8fzrIgQrt39GZ lqBycm3DFUQbYTN5TVvNjpvONkwQAnce4EJIRurW8F2j6gwsl7tIL6ue1ggwsXT5hxHgF6Xps1G/6 Y7LauQ5nHTrn5Ww9GMsqRF3zfu4K8+HMlJ3XF4d46dblZaUy4EWbxmG2ftOQwY2Dzo5PAjCbYHz/Q Q9icWQaNN3Jn4vN/sJ7kS5AF913wK5ywMNmIzkHSsE7UA7BaPYwzcLcDJnRmBioT8DHIixtalQm8I WRvFx3Cg==; Received: from [95.87.234.74] (port=60198 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jxYhM-00046m-1O; Mon, 20 Jul 2020 19:31:30 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/4] testsuite: Relax pattern to include "packed" targets Date: Mon, 20 Jul 2020 19:31:05 +0300 Message-Id: <20200720163106.27849-4-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200720163106.27849-1-dimitar@dinux.eu> References: <20200720163106.27849-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 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=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" The actual warning message depends on the default alignment of the target. With this update the test correctly passes on AVR and PRU targets. gcc/testsuite/ChangeLog: * gcc.dg/pr53037-1.c: Relax warning pattern. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.dg/pr53037-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/pr53037-1.c b/gcc/testsuite/gcc.dg/pr53037-1.c index 3ea5ae6a34e..b4e9049c746 100644 --- a/gcc/testsuite/gcc.dg/pr53037-1.c +++ b/gcc/testsuite/gcc.dg/pr53037-1.c @@ -40,7 +40,7 @@ struct foo5 { int i1; int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */ -}; /* { dg-warning "alignment 4 of 'struct foo5' is less than 16" } */ +}; /* { dg-warning "alignment .* of 'struct foo5' is less than 16" } */ struct foo6 { @@ -73,7 +73,7 @@ union bar3 { int i1; int x __attribute__((warn_if_not_aligned(16))); -}; /* { dg-warning "alignment 4 of 'union bar3' is less than 16" } */ +}; /* { dg-warning "alignment .* of 'union bar3' is less than 16" } */ union bar4 { From patchwork Mon Jul 20 16:31:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1332490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=NyuJKv5N; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9S1356kSz9sWl for ; Tue, 21 Jul 2020 02:31:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B2FB38618A2; Mon, 20 Jul 2020 16:31:35 +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 6224F3861862 for ; Mon, 20 Jul 2020 16:31:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6224F3861862 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@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:References:In-Reply-To: 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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=q3rSIrq49WaenHx5GUp0ZGn02wgOWjHIw+D79QF3fFw=; b=NyuJKv5NMYHoVHpgudO6ok9sfM Yr400i8tQTopZdFs53i1MttREQb/KhMi35hnxY5j82e9ON+snM7NlQQUdA7Hrk9N6vY/SmQHHy6Cr /+2P5cF54Qy0GPLICi6KsKVy+hxSFNMCRzO0oLeFJO7glc61ZuvoXJM9N+aHDgxec1AN5YO/HSQHo Z8sMvYLc0wojAjCNCk8aYwV7+foCcfqP1HB/PO2elvCoEWwIewmyeTedYQcUhA78zWp+9yqHYlcp1 perGPSVrj8R3mdOYbgjU6UssqXdVLbBw3eKrra1DRwsHjInawhbm2gK9SleR1oHwRV2I9dQUplEGX GaAJj3Jw==; Received: from [95.87.234.74] (port=60198 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jxYhO-00046m-87; Mon, 20 Jul 2020 19:31:32 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH 4/4] testsuite: Add default_packed filters Date: Mon, 20 Jul 2020 19:31:06 +0300 Message-Id: <20200720163106.27849-5-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200720163106.27849-1-dimitar@dinux.eu> References: <20200720163106.27849-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 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=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" Fix test cases assumptions that target has alignment constraints. gcc/testsuite/ChangeLog: * gcc.dg/attr-copy-4.c: Unpacked may still have alignment of 1 on targets with default_packed. * gcc.dg/c11-align-9.c: Remove AVR target filter and replace with default_packed filter. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.dg/attr-copy-4.c | 1 + gcc/testsuite/gcc.dg/c11-align-9.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/attr-copy-4.c b/gcc/testsuite/gcc.dg/attr-copy-4.c index 796724bb950..01fae3f78d4 100644 --- a/gcc/testsuite/gcc.dg/attr-copy-4.c +++ b/gcc/testsuite/gcc.dg/attr-copy-4.c @@ -32,6 +32,7 @@ extern const struct PackedA packed; struct Unpacked { int i; char c; }; Assert (__alignof (struct Unpacked) > 1); +/* { dg-error "size of array .* is negative" "" { target default_packed } .-1 } */ /* Verify that copying the packed attribute to the declaration of an object is ignored with a warning. (There should be diff --git a/gcc/testsuite/gcc.dg/c11-align-9.c b/gcc/testsuite/gcc.dg/c11-align-9.c index 3c9cf55756e..6a0d4248f1b 100644 --- a/gcc/testsuite/gcc.dg/c11-align-9.c +++ b/gcc/testsuite/gcc.dg/c11-align-9.c @@ -2,8 +2,8 @@ are at least some alignment constraints), case of compound literals. */ /* { dg-do compile } */ /* { dg-options "-std=c11 -pedantic-errors" } */ -/* { dg-skip-if "no alignment constraints" { "avr-*-*" } } */ #include -max_align_t *p = &(_Alignas (_Alignof (char)) max_align_t) { 1 }; /* { dg-error "reduce alignment" } */ +max_align_t *p = &(_Alignas (_Alignof (char)) max_align_t) { 1 }; +/* { dg-error "reduce alignment" "" { target { ! default_packed } } .-1 } */