Carsten Sørensen wrote:
On 10/09/2007, Pedro Alves <[EMAIL PROTECTED]> wrote:
Outch!  Looks like a bug alright.

It seems long long's in structures require 64-bit alignment.  You should be
able to work around it for now by introducing a dummy before f2.

It does. From the documentation
http://msdn2.microsoft.com/en-us/library/ms860980.aspx

"The __alignof value is the same as the value for sizeof for basic
types." (BTW, nice thing to keep in mind when porting code that uses
__alignof)


Thanks for the pointer.  Somehow I missed that.

I've built a cc1.exe with the attached patch applied, and I now get the
same alignments as the OP reported MSVC choses.  I'm doing a full
gcc build now.

The patch also forces 64-bit alignment on doubles, but I haven't
tested it yet - bonus points if someone tests it and compares it to
MSVC.

Cheers,
Pedro Alves

Index: gcc/gcc/config/arm/wince-pe.h
===================================================================
--- gcc/gcc/config/arm/wince-pe.h	(revision 838)
+++ gcc/gcc/config/arm/wince-pe.h	(working copy)
@@ -229,6 +229,13 @@
 #undef  DEFAULT_STRUCTURE_SIZE_BOUNDARY
 #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
 
+/* Force alignment of doubles to 64-bit.  */
+#undef ARM_DOUBLEWORD_ALIGN
+#define ARM_DOUBLEWORD_ALIGN	1
+
+#undef BIGGEST_ALIGNMENT
+#define BIGGEST_ALIGNMENT 64
+
 #undef TREE
 
 #ifndef BUFSIZ

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to