[Ffmpeg-cvslog] r8420 - trunk/libavcodec/dv.c

Roman Shaposhnik rvs
Sun Mar 25 06:17:47 CEST 2007


On Sat, 2007-03-24 at 23:21 -0500, Rich Felker wrote:
> >   Well it does (we've just implemented it in Sun Studio ;-)). The only
> > problem is -- you can't align to a stricter boundary than what
> > ABI mandates without generating extra code for function prologues.
> > Strictly speaking on x86 the largest alignment you can do is 4 and 
> > on x64 that would be 16. Now, given that every sensible x86 compiler
> > in the world tends to aligns on 8 anyway -- 8 is a pretty safe bet,
> > whereas 16 is NOT.  
> 
> The compiler does not align at all; 

  Yes, but it can REalign.

> it's a matter of what the calling
> code does. Thus all you can ever assume on x86 is 4. In order to be
> correct, the compiler must generate code to fully align the stack in
> any function that depends on the stack being aligned. gcc does not do
> this, so it's broken. Either they should fix this or document the fact
> that alignment attributes do not work on automatic variables.
 
  In Sun Studio compilers we've decided to do a combined approach
now -- we honor requests for alignment of the automatic variables 
up to the ABI requirements (although, it seems to be safe to assume
8 on Pentium+ these days for obvious reasons) and we issue a warning
if the requested alignment is higher. I believe it was suggested that
gcc guys do the same -- but they don't seem to be interested.

Thanks,
Roman.





More information about the ffmpeg-cvslog mailing list