[FFmpeg-devel] [PATCH]Force enable ebp_available for icc

Carl Eugen Hoyos cehoyos
Sat Mar 14 01:14:09 CET 2009


M?ns Rullg?rd <mans <at> mansr.com> writes:

> > The test used in configure to find out if ebp can be used worked fine
> > for icc up to version 10.1.
> > Since version 11.0, the test always fails, although ebp can be used (I
> > believe, because if I use attached configure patch, make test
> > succeeds).
> 
> In what way does the test fail with icc 11.0?

As explained, I reported this problem to Intel yesterday. I explained (possibly
not entirely correct) that we use this test to find out "if the ebp register can
be used in assembler code". I wrote the issue is that the test file compiles and
runs fine with gcc -fomit-frame-pointer (and fails with
-fno-omit-frame-pointer), that icc 10.1 behaves identically and that 11.0 and
11.1 fail, no matter if I use -fomit-frame-pointer or -fno-omit-frame-pointer.
I received an answer today:
[QUOTE]
I can reproduce this, and I've discussed this with our code generator team.
There is confusion here over what the -fomit-frame-pointer option actually does.
The FFmpeg configure script is counting on the use of the -fomit-frame-pointer
option to *require* the compiler to not use the ebp register as a frame pointer.
However, that is not what the option really does. The option tells the compiler
that it is free to use the ebp register as a general purpose register if the
compiler wishes. However in some cases it is still advantageous or even
necessary to maintain the frame pointer. In this case, starting in 11.0, in main
the Intel Compiler aligns the stack, and doing this it needs to maintain the
frame pointer to hold the original stack pointer. Another situation where the
compiler needs to maintain the frame pointer is when calls to alloca() are made.

As a workaround, the configure check could be done this way, and it will then
work with the Intel 11.0 and 11.1 compilers. Interestingly, gcc 3.4.3 always seg
faults for me on any version (other versions of gcc seem to be ok with the old
check):

$ cat ebp.c
__attribute__((noinline)) void foo() {
__asm__ volatile (
"xorl %%ebp, %%ebp"
::: "%ebp");
}

int main(void){
volatile int i=0;
foo();
return i;
}

There is still no guarantee (either on the gcc or the icc side) that this would
continue to work in the future, but it may not be worth the time for the
maintainer of FFmpeg to code a check that handles this more precisely.
[/QUOTE]

Any comments?
Is a patch changing the test acceptable?
Am I correct that we are not going to use ebp in main() anyway?

Thank you, Carl Eugen





More information about the ffmpeg-devel mailing list