[PATCH] Fix PR37216 [cygming] Invalid alignment for SSE store to .comm data generated with -O3

Dave Korn dave.korn.cygwin@googlemail.com
Sat May 23 22:17:00 GMT 2009


    Hi folks,

  In PR37216(*), GCC generates .comm variables for SSE data that requires
alignment.  GAS on ELF platforms supports a three-operand form of the .comm
directive that allows the alignment to be specified, but the PE object file
format doesn't define any way to pass alignment information of common data.

  As a GNU extension, upstream binutils now implements the three-operand
aligned .comm directive.  This patch adds a target-specific command-line
option, -mpe-aligned-commons, that tells GCC that it can go ahead and use the
aligned .comm format on Windows/i386.  It adds an autoconf test that checks at
configure time if the default assembler supports the format or not, and uses
that to set the default state of the target-specific option variable on or
off, but the user can always override this default if using a different
assembler post-installation.

  Bootstrapped on i686-pc-cygwin, and verified that it fixes 48 FAILs caused
by the gcc.dg/torture/stackalign/push-1.c test.  Also verified that when you
build it (non-bootstrap) without support in the assembler, the autoconf test
correctly detects this and sets the target option off by default.  Also read
the generated assembly files to verify they were emitting the correct forms of
the directive.

  Full testsuite now running on C, C++, Fortran and Java; will probably take
around two days to complete.

gcc/ChangeLog:

	PR target/37216
	* configure.ac (HAVE_GAS_ALIGNED_COMM):  Add autoconf test and
	macro definition for support of three-operand format aligned
	.comm directive in assembler on cygwin/pe/mingw target OS.
	* configure:  Regenerate.
	* config.h:  Regenerate.
	* doc/invoke.texi (-mpe-aligned-commons):  Document new target option.
	* config/i386/cygming.opt (-mpe-aligned-commons):  Add new option.
	* config/i386/winnt.c (i386_pe_asm_output_aligned_decl_common):  Use
	aligned form of .comm directive if -mpe-aligned-commons is in effect.

  If no regressions when the tests complete, OK for HEAD?

    cheers,
      DaveK
-- 
(*) - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pe-aligned-comm-patch.diff
Type: text/x-c
Size: 3060 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090523/d5035390/attachment.bin>


More information about the Gcc-patches mailing list