This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch/Testsuite] struct-layout-1_generate.c: Use -fno-common for cygwin and mingw32


The PE-COFF object format, as supported by GNU binintils, does allow
aligned common.

Several generated testcases in compat-struct-layout put objects
requiring large alignment into
.comm. In past, these have passed because of

(1) an ill-defined BIGGEST_FIELD_ALIGNMENT in config/i386/cygming.h
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33774

and

(2) failure to set the section alignment flags in object files as per
PE-COFF spec. The gas bug has been fixed in binutils CVS.
http://sourceware.org/ml/binutils/2007-11/msg00027.html

This patch adds the -fno-common flag to generated testcases for cygwin
and mingw targets so that I can fix BIGGEST_FIELD_ALIGNMENT bug without
causing testsuite regressions.


2007-11-08  Danny Smith  <dannysmith@users.sourceforge.net>

	* gcc.dg/compat/struct-layout-1_generate.c (dg-options) Add
	-fno-common for cygwin and mingw32.
Index: testsuite/gcc.dg/compat/struct-layout-1_generate.c
===================================================================
--- testsuite/gcc.dg/compat/struct-layout-1_generate.c	(revision 129863)
+++ testsuite/gcc.dg/compat/struct-layout-1_generate.c	(working copy)
@@ -763,7 +763,7 @@
     }
   fprintf (outfile, "\
 /* { dg-options \"-I%s\" } */\n\
-/* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* } } */\n\
+/* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
 /* { dg-options \"-I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
 #include \"struct-layout-1.h\"\n\
 \n\
@@ -790,7 +790,7 @@
     goto fail;
   fprintf (outfile, "\
 /* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* } } */\n\
+/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
 /* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
 #include \"struct-layout-1_x1.h\"\n\
 #include \"t%03d_test.h\"\n\
@@ -803,7 +803,7 @@
     goto fail;
   fprintf (outfile, "\
 /* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* } } */\n\
+/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
 /* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
 #include \"struct-layout-1_y1.h\"\n\
 #include \"t%03d_test.h\"\n\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]