From patchwork Fri Dec 16 09:01:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 131794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D7EE21007D4 for ; Fri, 16 Dec 2011 20:01:52 +1100 (EST) Received: (qmail 22071 invoked by alias); 16 Dec 2011 09:01:48 -0000 Received: (qmail 22048 invoked by uid 22791); 16 Dec 2011 09:01:45 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Dec 2011 09:01:32 +0000 Received: by obcwn6 with SMTP id wn6so437322obc.20 for ; Fri, 16 Dec 2011 01:01:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.31.78 with SMTP id y14mr3473690obh.25.1324026092164; Fri, 16 Dec 2011 01:01:32 -0800 (PST) Received: by 10.182.154.65 with HTTP; Fri, 16 Dec 2011 01:01:32 -0800 (PST) In-Reply-To: <4EEA25AA.5010909@gmail.com> References: <4EEA25AA.5010909@gmail.com> Date: Fri, 16 Dec 2011 10:01:32 +0100 Message-ID: Subject: Re: [patch testsuite g++.dg]: Reflect ABI change for windows native targets about bitfield layout in structures From: Kai Tietz To: Dave Korn Cc: Rainer Orth , GCC Patches X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2011/12/15 Dave Korn : > On 15/12/2011 10:33, Kai Tietz wrote: > >> -// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } } >> +// As for mingw target the the ms-bitfield switch is activated by default, >> +// make sure for this test that it is disabled. >> +// { dg-options "-mno-align-double -mno-ms-bitfields" { target i?86-*-cygwin* i >> ?86-*-mingw* } } > >  We don't use ms-bitfields on Cygwin, so I guess it wouldn't be expected to > do any harm anyway, but rather than setting the same options for both wouldn't > it be possible to do: Yes, I added it to this clause as the switch -mno-ms-bitfields is present for i?86-*-cygwin target too, and shouldn't cause here any harm. But I admit that the additional option itself is superflous for cygwin, but not for mingw. > { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } } > { dg-additional-options "-mno-ms-bitfields" { target i?86-*-mingw* } } > > ... so that MinGW gets both and Cygwin only the one it wants?  (Actually the > first one could just as well be changed to dg-additional-options at the same > time, couldn't it?) Well, interesting. I think it should be the additional variant for cygwin/mingw, as otherwise -O2 gets clobbered for it, isn't it? So I modified patch as attached. Cheers, Kai { Index: bitfield3.C =================================================================== --- bitfield3.C (revision 182092) +++ bitfield3.C (working copy) @@ -1,9 +1,12 @@ // Test for oversized bitfield alignment in structs on IA-32 // { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } // { dg-options "-O2" } -// Cygwin and mingw32 default to MASK_ALIGN_DOUBLE. Override to ensure +// Cygwin and mingw default to MASK_ALIGN_DOUBLE. Override to ensure // 4-byte alignment. -// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } } +// { dg-additional-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-m ingw* } } +// As for mingw target the the ms-bitfield switch is activated by default, +// make sure for this test that it is disabled. +// { dg-additional-options "-mno-ms-bitfields" { target i?86-*-mingw* } } struct A