[Ffmpeg-devel] [patch] strict-aliasing support

Michael Niedermayer michaelni
Tue Jul 4 02:16:17 CEST 2006


Hi

On Tue, Jul 04, 2006 at 12:42:18AM +0200, Luca Barbato wrote:
> Michael Niedermayer wrote:
> > Hi
> > 
> > not ok, some versions of gcc silently ignore attribute align for variables
> > on the stack, while they had no problem aligning double/uint64_t on the
> > stack correctly
> > 
> > 
> > [...]
> > 
> 
> I tested the following testcase on ppc, amd64 and x86 using gcc-4.1.1 on
> all of them and gcc-3.4.6 on x86, the value is correct for 16 and 8
> alignment. Could someone with a more ancient gcc test this testcase or
> equivalents?
> 
> 
> #include <stdio.h>
> 
> void f()
> {
>   int tmp[64] __attribute__((aligned(16)));

may i suggest rather something like:

char a __attribute__((aligned(16)));
char b __attribute__((aligned(16)));
char c __attribute__((aligned(16)));

and printf( ..., &a,&b,&c)

its less likely to be aligned correctly by pure chance

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list