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]

[v3] Alignment fix (was: Re: [v3] Fix codecvt_members_char.cc forbig endian machines)


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,



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