原文作者:hubertx
理论上来说,ARM的15个通用寄存器是通用的,但实际上并非如此,特别是在过程调用的过程中。
On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-description macro "FRAME_POINTER_REQUIRED" controls whether a target machine supports this flag.
==================================================================================
这里引用别人关于这一参数的实验,自己就不做了。
从实验可以看出,优化后的差别是相当明显的。当然,具体能带来多大的性能提升,不好界定。
另外,x86中EBP寄存器相当于ARM中的FP寄存器。
==================================================================================
http://blog.csdn.net/byzs/article/details/2220461
环境:X86+Redhat 9.0,gcc 3.2.2
源文件如下:
$ cat test.c
void a(unsigned long a, unsigned int b)
{
unsigned long i;
unsigned int j;
i = a;
j = b;
i++;
j += 2;
}
默认编译选项:
$ gcc -c test.c -o with_SFP.o
反汇编后是这个样子:
$ objdump -D with_SFP.o
with_SFP.o: file format elf32-i386
Disassembly of section .text:
00000000