From: Kai Tietz <ktietz70@googlemail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Henderson <rth@redhat.com>
Subject: [patch i386 mingw g++.dg gcc.dg]: Set -mms-bitfields as default for native windows targets
Date: Tue, 12 Apr 2011 12:47:00 -0000 [thread overview]
Message-ID: <BANLkTim30Qgovfpwu2kAP0mio_1x2ntftQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
Hello,
This patch enables by default for native Windows targets the
-mms-bitfields option, like the netware target does.
ChangeLog gcc/
* config/i386/mingw32.h (TARGET_SUBTARGET_DEFAULT): Add
MASK_MS_BITFIELD_LAYOUT bit.
ChangeLog gcc/testsuite
* g++.dg/ext/bitfield2.C: Add for i?86/x86_64-*-mingw*
targets the additional -mno-ms-bitfields and
-Wno-packed-bitfield-compat options.
* g++.dg/ext/bitfield3.C: Likewise.
* g++.dg/ext/bitfield4.C: Likewise.
* g++.dg/ext/bitfield5.C: Likewise.
* gcc.dg/bitfld-15.c: Likewise.
* gcc.dg/bitfld-16.c: Likewise.
* gcc.dg/bitfld-17.c: Likewise.
* gcc.dg/bitfld-18.c: Likewise.
Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_&4-pc-linux-gnu. Ok for apply?
Regards,
Kai
[-- Attachment #2: wt_msbitfield.txt --]
[-- Type: text/plain, Size: 5968 bytes --]
Index: gcc/gcc/config/i386/mingw32.h
===================================================================
--- gcc.orig/gcc/config/i386/mingw32.h 2011-04-12 12:07:34.000000000 +0200
+++ gcc/gcc/config/i386/mingw32.h 2011-04-12 12:13:05.891324300 +0200
@@ -22,6 +22,17 @@ along with GCC; see the file COPYING3.
#undef DEFAULT_ABI
#define DEFAULT_ABI MS_ABI
+/* By default, target has a 80387, uses IEEE compatible arithmetic,
+ returns float values in the 387 and needs stack probes.
+ We also align doubles to 64-bits for MSVC default compatibility.
+ Additionally we enable MS_BITFIELD_LAYOUT by default. */
+
+#undef TARGET_SUBTARGET_DEFAULT
+#define TARGET_SUBTARGET_DEFAULT \
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS \
+ | MASK_STACK_PROBE | MASK_ALIGN_DOUBLE \
+ | MASK_MS_BITFIELD_LAYOUT)
+
/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
is for compatibility with native compiler. */
#define EXTRA_OS_CPP_BUILTINS() \
Index: gcc/gcc/testsuite/g++.dg/ext/bitfield2.C
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/ext/bitfield2.C 2010-11-11 18:00:57.000000000 +0100
+++ gcc/gcc/testsuite/g++.dg/ext/bitfield2.C 2011-04-12 14:32:33.112826500 +0200
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* Remove pedantic. Allow the GCC extension to use char for bitfields. */
/* { dg-options "" } */
-/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
{
Index: gcc/gcc/testsuite/g++.dg/ext/bitfield3.C
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/ext/bitfield3.C 2010-09-09 16:04:53.000000000 +0200
+++ gcc/gcc/testsuite/g++.dg/ext/bitfield3.C 2011-04-12 12:29:11.612455300 +0200
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
Index: gcc/gcc/testsuite/g++.dg/ext/bitfield4.C
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/ext/bitfield4.C 2010-11-11 18:00:57.000000000 +0100
+++ gcc/gcc/testsuite/g++.dg/ext/bitfield4.C 2011-04-12 14:33:10.989636200 +0200
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "" } */
-/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
struct t /* { dg-message "note: offset of packed bit-field 't::b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
{
Index: gcc/gcc/testsuite/g++.dg/ext/bitfield5.C
===================================================================
--- gcc.orig/gcc/testsuite/g++.dg/ext/bitfield5.C 2010-09-09 16:04:52.000000000 +0200
+++ gcc/gcc/testsuite/g++.dg/ext/bitfield5.C 2011-04-12 14:33:35.115199800 +0200
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
-/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-netware i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
Index: gcc/gcc/testsuite/gcc.dg/bitfld-15.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.dg/bitfld-15.c 2010-11-11 18:00:57.000000000 +0100
+++ gcc/gcc/testsuite/gcc.dg/bitfld-15.c 2011-04-12 14:23:33.380789200 +0200
@@ -2,6 +2,7 @@
/* Remove pedantic. Allow the GCC extension to use char for bitfields. */
/* { dg-options "" } */
/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
Index: gcc/gcc/testsuite/gcc.dg/bitfld-16.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.dg/bitfld-16.c 2010-09-09 16:02:35.000000000 +0200
+++ gcc/gcc/testsuite/gcc.dg/bitfld-16.c 2011-04-12 12:22:00.129163900 +0200
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
Index: gcc/gcc/testsuite/gcc.dg/bitfld-17.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.dg/bitfld-17.c 2010-11-11 18:00:57.000000000 +0100
+++ gcc/gcc/testsuite/gcc.dg/bitfld-17.c 2011-04-12 14:29:02.181541600 +0200
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "" } */
/* { dg-options "-mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
Index: gcc/gcc/testsuite/gcc.dg/bitfld-18.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.dg/bitfld-18.c 2010-09-09 16:02:30.000000000 +0200
+++ gcc/gcc/testsuite/gcc.dg/bitfld-18.c 2011-04-12 14:24:04.904792200 +0200
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-Wno-packed-bitfield-compat" } */
/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target i?86-*-netware } } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
struct t
{
next reply other threads:[~2011-04-12 12:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 12:47 Kai Tietz [this message]
2011-04-12 17:47 ` Richard Henderson
2011-04-12 18:53 ` Kai Tietz
2011-04-13 10:37 ` Pedro Alves
2011-04-13 10:43 ` Kai Tietz
2011-04-13 10:49 ` Pedro Alves
2011-11-08 19:19 ` Dave Korn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTim30Qgovfpwu2kAP0mio_1x2ntftQ@mail.gmail.com \
--to=ktietz70@googlemail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).