<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>how to use -fomit-frame-pointer for one file only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12356/how-to-use--fomit-frame-pointer-for-one-file-only</link><description>Hello, 
 I am trying to remove the use of the frame pointers for bootloader_util.c because I am getting the error : &amp;quot;r7 cannot be used in asm here&amp;quot;, but I only know how to remove the frame pointers to all files by using -fomit-frame-pointer in CFLAGS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Mar 2016 14:48:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12356/how-to-use--fomit-frame-pointer-for-one-file-only" /><item><title>RE: how to use -fomit-frame-pointer for one file only</title><link>https://devzone.nordicsemi.com/thread/46732?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 14:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a4c78e4-4ea1-4493-90c0-ddb2fb87a5c7</guid><dc:creator>seanbites</dc:creator><description>&lt;p&gt;I am running sdk9.2 and version 5.2 2015q4 of gnu tools. I do not get the error if I omit the frame pointers, which seems to work fine for now. Thank you very much for the above explanation and link, if I encounter any debugging issues, I&amp;#39;ll definitely refer to this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use -fomit-frame-pointer for one file only</title><link>https://devzone.nordicsemi.com/thread/46731?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 14:35:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fda6edc7-fe7b-4fdf-ad1b-0057e516fd03</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Optimize-Options.html"&gt;If you use any optimization except -O0, -fomit-frame-pointer will be used&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;-fomit-frame-pointer&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t keep the frame pointer in a register for
functions that don&amp;#39;t need one. This
avoids the instructions to save, set
up and restore frame pointers; it also
makes an extra register available in
many functions. It also makes
debugging impossible on some machines.
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&amp;#39;t exist. The
machine-description macro
FRAME_POINTER_REQUIRED controls
whether a target machine supports this
flag. See Register Usage.&lt;/p&gt;
&lt;p&gt;Enabled at levels -O, -O2, -O3, -Os.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can use pragma:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#pragma GCC push_options
#pragma GCC optimize (&amp;quot;O0&amp;quot;)

ret = do_something();

#pragma GCC pop_options
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or if you want to set it on the specific function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int some_func(void) __attribute__((optimize(&amp;quot;-O0&amp;quot;)));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This error is not shown on my end (arm-none-eabi v4.9.3, SDK 10), I even tested with lto set as well.&lt;/p&gt;
&lt;p&gt;What SDK version are you using? And which version of arm-none-eabi are you using?&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use -fomit-frame-pointer for one file only</title><link>https://devzone.nordicsemi.com/thread/46730?ContentTypeID=1</link><pubDate>Sun, 06 Mar 2016 16:04:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41e610fa-2c57-4ad8-93bd-636fa48de31d</guid><dc:creator>seanbites</dc:creator><description>&lt;p&gt;Say that I were compelled to do it anyways (I believe this is something that is useful to know), how would I go about doing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use -fomit-frame-pointer for one file only</title><link>https://devzone.nordicsemi.com/thread/46729?ContentTypeID=1</link><pubDate>Sun, 06 Mar 2016 00:40:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea02857-6028-4e61-bde0-6f8248218a87</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;it&amp;#39;s easier just to remove the r7 from that line, it&amp;#39;s not really needed anyway&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>