<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPCXpresso IDEのトピックProblem with optimized build</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problem-with-optimized-build/m-p/596899#M32018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhysicsGuy on Thu Apr 04 06:30:12 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a little problem with an optimized build on an lpc1769.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The situation is the following. In main, I loop in a while loop, that does nothing but check whether a certain variable is set and when it is set, it calls a function. So&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while(1==1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(somevariable==1) do_something();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some variable is set and unset by an external interrupt. Now comes the problem. When I compile with -O1 or higher, the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;compiler puts somevariable in a register first and then keep checking the register. However, the interrupt routine ofcourse&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;does not alter the register value, but rather the value in memory. How can I prevent this from happening? Can I tell the compiler to not make that specific optimization?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:59:56 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:59:56Z</dc:date>
    <item>
      <title>Problem with optimized build</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problem-with-optimized-build/m-p/596899#M32018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhysicsGuy on Thu Apr 04 06:30:12 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a little problem with an optimized build on an lpc1769.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The situation is the following. In main, I loop in a while loop, that does nothing but check whether a certain variable is set and when it is set, it calls a function. So&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while(1==1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(somevariable==1) do_something();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some variable is set and unset by an external interrupt. Now comes the problem. When I compile with -O1 or higher, the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;compiler puts somevariable in a register first and then keep checking the register. However, the interrupt routine ofcourse&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;does not alter the register value, but rather the value in memory. How can I prevent this from happening? Can I tell the compiler to not make that specific optimization?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:59:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problem-with-optimized-build/m-p/596899#M32018</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with optimized build</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problem-with-optimized-build/m-p/596900#M32019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Thu Apr 04 07:05:32 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Read this FAQ:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/CompilerOptimization&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:59:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problem-with-optimized-build/m-p/596900#M32019</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:59:57Z</dc:date>
    </item>
  </channel>
</rss>

