<?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: Warning C12056 in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Warning-C12056/m-p/203697#M7779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It did you try to disable the common code optimization with -onf?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What it means is that the stackpointer has different values in a single location in a function depending on how the code gets to this location. With the common code optimization (to disable use -onf) this may happen in legal code.&lt;/P&gt;&lt;P&gt;Conceptually this happens for a setup like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void fun(void)&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PSHA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PULA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC is a list of identical assembly instructions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this setup, the compiler moves the common code part CC to a new location and replaces the two old locations with JSR to the shared place for CC. As the two JSR's are located at different SP levels, the compiler issues the warning for the new location of the CC code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;optimized function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void fun(void)&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;JSR&amp;nbsp;CC_Label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PSHA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;JSR&amp;nbsp;CC_Label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PULA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC_Label:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 May 2010 09:52:32 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2010-05-28T09:52:32Z</dc:date>
    <item>
      <title>Warning C12056</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Warning-C12056/m-p/203696#M7778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using CW 5.9.0 with a 9S12C32. After some recent edits, I am now getting the compiler message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;_&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: helvetica; font-size: 3;"&gt;Warning: C12056: SP debug info incorrect because of optimization or inline assembler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: helvetica; font-size: 3;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;No inline assembly is involved, except the macro EnableInterrupt, and no amount of disabling optimizations makes this message go away.&lt;/P&gt;&lt;P&gt;I can't blame any code misbehavior on this (wish I could) but I would like to know exactly what it means. The help-file explanation is a real eye-glazer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wade H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 23:01:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Warning-C12056/m-p/203696#M7778</guid>
      <dc:creator>WadeH</dc:creator>
      <dc:date>2010-05-27T23:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Warning C12056</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Warning-C12056/m-p/203697#M7779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It did you try to disable the common code optimization with -onf?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What it means is that the stackpointer has different values in a single location in a function depending on how the code gets to this location. With the common code optimization (to disable use -onf) this may happen in legal code.&lt;/P&gt;&lt;P&gt;Conceptually this happens for a setup like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void fun(void)&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PSHA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PULA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC is a list of identical assembly instructions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this setup, the compiler moves the common code part CC to a new location and replaces the two old locations with JSR to the shared place for CC. As the two JSR's are located at different SP levels, the compiler issues the warning for the new location of the CC code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;optimized function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void fun(void)&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;JSR&amp;nbsp;CC_Label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PSHA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;JSR&amp;nbsp;CC_Label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;PULA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC_Label:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;CC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;RTS&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 May 2010 09:52:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Warning-C12056/m-p/203697#M7779</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2010-05-28T09:52:32Z</dc:date>
    </item>
  </channel>
</rss>

