Frame pointer not getting eliminated

U.Mutlu um@mutluit.com
Fri Mar 29 12:54:00 GMT 2019


William Tambe wrote on 03/29/2019 03:24 AM:
> On Thu, Mar 28, 2019 at 3:07 PM Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
>>
>> Hi!
>>
>> On Thu, Mar 28, 2019 at 12:26:13PM -0500, William Tambe wrote:
>>> I am doing porting work and writing a backend using GCC 8.2.0.
>>>
>>> Despite the following #defines, the frame pointer is not getting
>>> eliminated; any idea why GCC would still generate a frame pointer ?
>>
>> Do you use -fomit-frame-pointer (perhaps indirectly from -O, or from a
>> default)?
>
> -O2 is being used; I can't tell whether -fomit-frame-pointer is being used.

Hi,
try the following script (4 lines) to get a list of all the effective options 
for each of gcc and g++.
Replace with your compiler's path and names.
The results will be in the two *.t files:

#!/bin/bash
CCDIR=/sw/src/cross/INSTALL_DIR
echo "int main() { return 0; }" | $CCDIR/bin/arm-linux-gnueabihf-gcc -Q -v -x 
c   -Ofast -  >cpl_options_gcc.t 2>&1 ; rm a.out
echo "int main() { return 0; }" | $CCDIR/bin/arm-linux-gnueabihf-g++ -Q -v -x 
c++ -Ofast -  >cpl_options_g++.t 2>&1 ; rm a.out


-- 
U.Mutlu



More information about the Gcc-help mailing list