<?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>Classic/Legacy CodeWarrior中的主题 Re: Compiler not preserving local variable in while loop</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131957#M554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stack overflow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jul 2011 17:53:34 GMT</pubDate>
    <dc:creator>Lundin</dc:creator>
    <dc:date>2011-07-07T17:53:34Z</dc:date>
    <item>
      <title>Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131950#M547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using CodeWarrior 5.6.1 for an MCF5270 target.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While debugging an error in my application I found the problem to be a local variable -- initialized once and used inside a while loop -- was unexpectedly changed during the loop body.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The variable was assigned by the compiler to a register, and the same register is used inside a function, called within the loop body. This overwrites my local var.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm all for optimal register use, but if the compiler chose a register (D3 in this case), why would it not preserve (push) the reg value around a function using that register?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a compiler error? Has anyone else seen this? Or, can certain coding practices fool the compiler to not saving the local variable around function calls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Source / compiled source is available but the specific case where I have proved this error does not lend itself to a clear example posting for forums.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Joel.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 09:21:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131950#M547</guid>
      <dc:creator>theJoel</dc:creator>
      <dc:date>2007-04-27T09:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131951#M548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;You need to submit a service request&amp;nbsp; for that to get one of our support engineer looking into that&lt;BR /&gt;Click &lt;A href="https://www.freescale.com/webapp/servicerequest.create_SR.framework?regFlag=fromOpenSR" rel="nofollow" target="_blank"&gt;here&lt;/A&gt; to submit a service request..&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Make sure to attach&amp;nbsp; a project reproducing the issue and installed product information to the SR.&lt;BR /&gt;To make sure you provide all necessary project information, you can use the Pack and Go wizard.&lt;BR /&gt;&amp;nbsp; - Start the IDEA&lt;BR /&gt;&amp;nbsp; - Open the Project&lt;BR /&gt;&amp;nbsp; - Select Help -&amp;gt; "Pack and Go"&lt;BR /&gt;&amp;nbsp; - Follow the instruction on the screen. That will generate a zip file containing all necessary &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; information (including the installed product information). &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 12:45:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131951#M548</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-04-27T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131952#M549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;CrasyCat wrote:&lt;BR /&gt;To make sure you provide all necessary project information, you can use the Pack and Go wizard.&lt;BR /&gt;&amp;nbsp;- Start the IDEA&lt;BR /&gt;&amp;nbsp;- Open the Project&lt;BR /&gt;&amp;nbsp;- Select Help -&amp;gt; "Pack and Go"&lt;BR /&gt;&amp;nbsp;- Follow the instruction on the screen. That will generate a zip file containing all necessary&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;information (including the installed product information).&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Hey, what's the big "IDEA"! &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; ...you mentioned?&lt;BR /&gt;What is Pack and Go?&lt;BR /&gt;&lt;BR /&gt;I have no such options.&lt;BR /&gt;&lt;BR /&gt;I have a purchased copy of CW 5.6.1 but do not have an active support agreement. I know I can prove this issue, but will my Service Request be considered? And, will they correct the problem in my compiler version?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am also looking for other options and forum input, ie. change of coding style, turning off certain optimizations, etc.. anything to guarantee our C algorithms are compiled as intended.&lt;BR /&gt;&lt;BR /&gt;I can no longer be confident this isn't happening throughout our application.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Joel.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Apr 2007 00:08:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131952#M549</guid>
      <dc:creator>theJoel</dc:creator>
      <dc:date>2007-04-28T00:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: CW5.6.1 MCF5270 - Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131953#M550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello Joel,&lt;BR /&gt;&lt;BR /&gt;CrasyCat meant the IDE for Integrated Develpment Environment or something like this.&lt;BR /&gt;In clear, start CodeWarrior and follow instructions.&lt;BR /&gt;&lt;BR /&gt;Pack and Go is an option which allow easier support on projects.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;YES, your service requests WILL be looked at. You probably won't have the higher priority, of course.&lt;BR /&gt;&lt;BR /&gt;Note for later, though... &lt;B&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=3819" target="_blank"&gt;Please read this post.............&lt;/A&gt;&lt;/B&gt;&lt;BR /&gt;Also, there is a special folder for MCF5270 questions.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Alban.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by Alban on &lt;SPAN class="date_text"&gt;2007-04-28&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:45 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Apr 2007 22:42:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131953#M550</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2007-04-28T22:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: CW5.6.1 MCF5270 - Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131954#M551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Pack and Go was added in a 6.X version (6.3?). So your ide does probably not have it.&lt;BR /&gt;Anyway, its a tool to collect all the files to report the bug and it creates a zip file to be sent to support. It would be good if support would be able to compile and run the incorrect code on their own so they have everhing too see how this bug happens.&lt;BR /&gt;&lt;BR /&gt;About the actual bug, I think (not 100%) that for ColdFire D3 is callee saved. This means that the code with the loop is actually OK and its the function called (which does overwrite the D3 without saving it first) which contains the bug.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Apr 2007 19:22:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131954#M551</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-04-29T19:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: CW5.6.1 MCF5270 - Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131955#M552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks Daniel&lt;BR /&gt;&lt;BR /&gt;No I don't have Pack and Go. But I can make a zip file of my project settings and source code.&lt;BR /&gt;&lt;BR /&gt;I'm not really comfortable sending our entire source directory but I will try demonstrate the problem in a stripped down project directory. Perhaps in the process I will even see where the compiler is breaking.&lt;BR /&gt;&lt;BR /&gt;I'll post here if I find anything.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Joel.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2007 00:59:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131955#M552</guid>
      <dc:creator>theJoel</dc:creator>
      <dc:date>2007-05-01T00:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131956#M553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Joel&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Did you find the answer that you were looking for. I have got the same problem as yours. I donot know&amp;nbsp;how the&amp;nbsp;local variable changes itself without assigning any values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you have solved then could you give some advice to me.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 10:02:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131956#M553</guid>
      <dc:creator>blackjack</dc:creator>
      <dc:date>2011-07-07T10:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler not preserving local variable in while loop</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131957#M554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stack overflow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 17:53:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-not-preserving-local-variable-in-while-loop/m-p/131957#M554</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2011-07-07T17:53:34Z</dc:date>
    </item>
  </channel>
</rss>

