This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Alignment fix (was: Re: [v3] Fix codecvt_members_char.cc forbig endian machines)
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Mar 2002 01:14:49 +0100
- Subject: [v3] Alignment fix (was: Re: [v3] Fix codecvt_members_char.cc forbig endian machines)
- References: <3C9F257C.8030500@unitus.it> <20020325151153.F15489@redhat.com>
Richard Henderson wrote:
>If you're going to do this, you have to make sure that the
>i_lit_base array is sufficiently aligned.
>
>Use __attribute__((aligned(__alignof__(int_type)))).
>
I have tested i686-pc-linux-gnu the below. Ok?
Ciao, Paolo.
//////////////
2002-03-25 Paolo Carlini <pcarlini@unitus.it>
Richard Henderson <rth@redhat.com>
* testsuite/22_locale/codecvt_members_unicode_char.cc
(test01, test02): make sure that the i_lit_base array
is sufficiently aligned.
--- codecvt_members_unicode_char.cc.orig Tue Mar 26 01:09:44 2002
+++ codecvt_members_unicode_char.cc Tue Mar 26 00:52:43 2002
@@ -72,7 +72,7 @@
const ext_type* e_lit = "black pearl jasmine tea";
int size = strlen(e_lit);
- char i_lit_base[50] =
+ char i_lit_base[50] __attribute__((aligned(__alignof__(int_type)))) =
{
0x00, 0x62, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x20,
0x00, 0x70, 0x00, 0x65, 0x00, 0x61, 0x00, 0x72, 0x00, 0x6c, 0x00, 0x20,
@@ -159,7 +159,7 @@
const ext_type* e_lit = "black pearl jasmine tea";
int size = strlen(e_lit);
- char i_lit_base[50] =
+ char i_lit_base[50] __attribute__((aligned(__alignof__(int_type)))) =
{
0x62, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x20, 0x00,
0x70, 0x00, 0x65, 0x00, 0x61, 0x00, 0x72, 0x00, 0x6c, 0x00, 0x20, 0x00,