<?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>topic Re: Compiler bug, CW 8.3, 56F807, FYI in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826797#M7553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Thank you for posting your issue.&lt;/P&gt;&lt;P&gt;To investigate the problem, we need more information:&lt;/P&gt;&lt;P&gt;1. Your CW version&lt;/P&gt;&lt;P&gt;2. Please create a demo project for us. Thus we can reproduce the problem directly.&lt;/P&gt;&lt;P&gt;3. Screenshot of how to reproduce your problem step by step.&lt;/P&gt;&lt;P&gt;Thanks for your cooperation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Sep 2018 09:25:05 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2018-09-17T09:25:05Z</dc:date>
    <item>
      <title>Compiler bug, CW 8.3, 56F807, FYI</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826796#M7552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI.&lt;/P&gt;&lt;P&gt;I run into compiler bug in these DSC compiler with reasonable frequency. I don't usually post them. I decided to post this one today as I have the bandwidth today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These Legacy DSC compiler are buggy and, in my opinion, not finished. It is amazing that in its day it was actually considered a finished product. So much so that there has been no improvements in over 15 years. the help file is incomplete. It doesn't support post-build steps. It can't load symbol tables. It doesn't allow erase &amp;amp; program of select memory section while in debug to load bootloaders &amp;amp; apps for test. Several controls\menu items are not supported. Even the DSC compiler that is in CW 10\11 is just the old compiler &amp;amp; debugger with a new face. Too much MetroWerks DNA in these tools, just terrible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is amazing that they could charge so much for the compiler back in the day. Compared to Code Composer 2.2 &amp;amp;3.3 which are of a similar vintage, the MetroWerks\Motorola\Freescale\NXP Legacy CW looks like a high-school project. What is MORE AMAZING, it that it costs so much NOW, a nearly 20 year old product that was terrible 20 years ago. Talk about bilking the customer??!! Even, the community had to hack &amp;amp; document the tool to run it on 64-bit. You would think that at $2500-a-pop, that re-bundling of the installer would be done for the user-base as a released even if no improvements were made to the tool.&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Anyway, that leads to this compiler bug. I am trying to compare a 32-bit variable in a structure to a #defined constant using C. The issue is that the accumulators are 40-bit. When loading the constant, the compiler clears the upper 8-bits (32-39). However, when it loads the variable, the compiler does NOT clear these upper bits and the compare fails because there is left-over garbage there from who-knows-what.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached image....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;#define FDL_ERASE_REQ_ENA&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;0xAA55AB39UL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;if(FDL_stat.EraseFlashRequest == FDL_ERASE_REQ_ENA)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding\omitting the UL suffix on the #define, no difference.&lt;/P&gt;&lt;P&gt;I have tried ANDing the variable with a mask, no difference.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;if( (FDL_stat.EraseFlashRequest &amp;amp; 0xFFFFFFFF) == FDL_ERASE_REQ_ENA)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is occurring on the 56F807. I will say that the same code seems to work on the 56F8307 but I ran into 5 places in 8307 where I had to work around other compiler bugs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the solution was to break up the unsigned long into 2 integers and compare those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned int CompilerBugFix1a, CompilerBugFix1b, CompilerBugFix2a, CompilerBugFix2b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CompilerBugFix1a = FDL_stat.EraseFlashRequest &amp;amp; 0x0000FFFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CompilerBugFix1b = FDL_stat.EraseFlashRequest &amp;amp; 0xFFFF0000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CompilerBugFix2a = FDL_ERASE_REQ_ENA &amp;amp; 0x0000FFFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CompilerBugFix2b = FDL_ERASE_REQ_ENA &amp;amp; 0xFFFF0000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(CompilerBugFix1a == CompilerBugFix2a)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;asm(nop);&amp;nbsp; //Works! Hits this breakpoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(CompilerBugFix1b == CompilerBugFix2b)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;asm(nop);&amp;nbsp; //Works! Hits this breakpoint&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 11px;"&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 13:14:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826796#M7552</guid>
      <dc:creator>j___</dc:creator>
      <dc:date>2018-09-14T13:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug, CW 8.3, 56F807, FYI</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826797#M7553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Thank you for posting your issue.&lt;/P&gt;&lt;P&gt;To investigate the problem, we need more information:&lt;/P&gt;&lt;P&gt;1. Your CW version&lt;/P&gt;&lt;P&gt;2. Please create a demo project for us. Thus we can reproduce the problem directly.&lt;/P&gt;&lt;P&gt;3. Screenshot of how to reproduce your problem step by step.&lt;/P&gt;&lt;P&gt;Thanks for your cooperation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2018 09:25:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826797#M7553</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2018-09-17T09:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler bug, CW 8.3, 56F807, FYI</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826798#M7554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jennie,&lt;/P&gt;&lt;P&gt;I just posted this as an FYI in case other users run into this issue. I already worked around it as I described.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the tools are crap and were never finished back in the day. The fact that customers have to pay for these 20-year-old, unfinished, buggy tools is just legal robbery from the "once-loyal" customer-base. I realize this is not your issue, it goes higher than that. However, it is not good marketing on Freescale &amp;amp; now NXP's part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, there is no need to take this further. That is why you will not be receiving a test-case project from me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2018 16:05:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Compiler-bug-CW-8-3-56F807-FYI/m-p/826798#M7554</guid>
      <dc:creator>j___</dc:creator>
      <dc:date>2018-09-22T16:05:25Z</dc:date>
    </item>
  </channel>
</rss>

