This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Double alignment trouble



On 08-Feb-1999, OSKAR BERRETEAGA <oskarb@fagorautomation.es> wrote:
> 
> I've been trying to change the way gcc aligns double type variables but
> with no possitive result.

The newsgroup gnu.gcc.help might be a more appropriate forum for this
question.

> These are the options I've set with gcc: -malign-double (alone or with
> one of the following -march='pentium' -m386 -m486) and the full command
> line is: gcc -c test.c -malign-double -o test.o

`-malign-double' is the default.  If you want to disable it, you need
to use `-mno-align-double'.  However, this will typically have a
negative effect on performance, and may cause binary compatibility
problems, so I don't recommend using this option.

> I've even used the  __attribute__((aligned(2))) for both the struct and
> the double var but, again, it seems it has no effect on double
> alignment.

Please RTFM. The documentation of the `aligned' attribute is quite clear:

 |	This attribute specifies a minimum alignment ...
 ...	                           ^^^^^^^^
 |	The `aligned' attribute can only increase the alignment;
 |	but you can decrease it by specifying `packed' as well.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh@128.250.37.3        |     -- leaked Microsoft memo.

--   
Want to unsubscribe from this list?                             
Send a message to cygwin-unsubscribe@sourceware.cygnus.com