<?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: S12Z compiler CodeWarrior 10.7 compiler optimization and safety in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/S12Z-compiler-CodeWarrior-10-7-compiler-optimization-and-safety/m-p/1400259#M15642</link>
    <description>&lt;P&gt;HI&amp;nbsp;devauxt&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please turn off compiler optimization if your project is safety requirement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the optimized code is not strictly equal to the original source code. I haven't see safety required design using optimization.&lt;/P&gt;
&lt;P&gt;If I remember correct, NXP&amp;nbsp;&lt;A id="designResources_title1" href="https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SWS12Z-SCST001E" data-dtmaction="Software &amp;amp; Tools tab: Developer Resources - Download Link click" data-dtmsubaction="S12Z Core Self-Test Software " target="_blank"&gt;S12Z Core Self-Test Software&amp;nbsp;&amp;nbsp;&lt;/A&gt;for safety, quality test code all turns of optimization.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/s12-magniv-mixed-signal-mcus/s12zvc-mixed-signal-mcu-for-automotive-industrial-can-applications:S12ZVC?tab=Design_Tools_Tab" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/s12-magniv-mixed-signal-mcus/s12zvc-mixed-signal-mcu-for-automotive-industrial-can-applications:S12ZVC?tab=Design_Tools_Tab&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jan 2022 11:11:18 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2022-01-17T11:11:18Z</dc:date>
    <item>
      <title>S12Z compiler CodeWarrior 10.7 compiler optimization and safety</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/S12Z-compiler-CodeWarrior-10-7-compiler-optimization-and-safety/m-p/1397216#M15638</link>
      <description>&lt;P&gt;Hello every one,&lt;/P&gt;&lt;P&gt;I am working on a S12Z controller in a automotive project with some safety requirements allocated to the controller (ASIL B).&lt;/P&gt;&lt;P&gt;As we are now facing a very high usage of the memory, in particular the ROM, we are considering switching ON the compiler optimization (up to level 2 – size over speed).&lt;/P&gt;&lt;P&gt;In the compiler manual (MCU_S12Z_Compiler.pdf), we can get a very limited amount of information concerning the optimization themselves.&lt;/P&gt;&lt;P&gt;Is there some recommendation whatsoever from NXP about the activation of compiler optimization, in particular in a safety context ? (do not activate at all ? / what to check or to do in addition if you activate ? / anything else ?)&lt;/P&gt;&lt;P&gt;Could anyone provide more details about the compiler optimizations ?&lt;/P&gt;&lt;P&gt;Basically from the compiler manual:&lt;/P&gt;&lt;P&gt;Sets a specific optimization level. The options for num are:&lt;BR /&gt;• 0 - Suppress all optimizations&lt;BR /&gt;• 1 - High Level Optimizations, Branch Optimization&lt;BR /&gt;• 2 - Constant Propagation, Copy Propagation, Dead Code Elimination, Register&lt;BR /&gt;Allocation, Peephole, Common Subexpression Elimination, Branch Tail Merge&lt;BR /&gt;• 3 - Constant Propagation, Copy Propagation, Dead Code Elimination, Register&lt;BR /&gt;Allocation, Peephole, Common Subexpression Elimination, Branch Tail Merge&lt;/P&gt;&lt;P&gt;And&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specify the optimizations that you want the compiler to apply to the generated object code. The options available are as follows:&lt;BR /&gt;Off (default) - Disables optimizations. This setting is equivalent to specifying the -O0 command-line option. The compiler generates unoptimized, linear assembly-language code.&lt;BR /&gt;1 - The compiler performs all target-independent (that is, nonparallelized) optimizations, such as function inlining. This setting is equivalent to specifying the -O1 command-line option. The compiler omits all target-specific optimizations and generates linear assembly-language code.&lt;BR /&gt;2 - The compiler performs all optimizations (both targetindependent and target-specific). This setting is equivalent to specifying the -O2 command-line option. The compiler outputs optimized, non-linear, parallelized assembly-language code.&lt;BR /&gt;3 - The compiler performs all the level 2 optimizations, then the low-level optimizer performs global-algorithm register allocation. This setting is equivalent to specifying the -O3 command-line option. At this optimization level, the compiler generates code that is usually faster than the code generated from level 2 optimizations. By default, the optimization is disabled for S12Z Compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Thomas.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 08:21:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/S12Z-compiler-CodeWarrior-10-7-compiler-optimization-and-safety/m-p/1397216#M15638</guid>
      <dc:creator>devauxt</dc:creator>
      <dc:date>2022-01-11T08:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z compiler CodeWarrior 10.7 compiler optimization and safety</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/S12Z-compiler-CodeWarrior-10-7-compiler-optimization-and-safety/m-p/1400259#M15642</link>
      <description>&lt;P&gt;HI&amp;nbsp;devauxt&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please turn off compiler optimization if your project is safety requirement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the optimized code is not strictly equal to the original source code. I haven't see safety required design using optimization.&lt;/P&gt;
&lt;P&gt;If I remember correct, NXP&amp;nbsp;&lt;A id="designResources_title1" href="https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SWS12Z-SCST001E" data-dtmaction="Software &amp;amp; Tools tab: Developer Resources - Download Link click" data-dtmsubaction="S12Z Core Self-Test Software " target="_blank"&gt;S12Z Core Self-Test Software&amp;nbsp;&amp;nbsp;&lt;/A&gt;for safety, quality test code all turns of optimization.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/s12-magniv-mixed-signal-mcus/s12zvc-mixed-signal-mcu-for-automotive-industrial-can-applications:S12ZVC?tab=Design_Tools_Tab" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/s12-magniv-mixed-signal-mcus/s12zvc-mixed-signal-mcu-for-automotive-industrial-can-applications:S12ZVC?tab=Design_Tools_Tab&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 11:11:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/S12Z-compiler-CodeWarrior-10-7-compiler-optimization-and-safety/m-p/1400259#M15642</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2022-01-17T11:11:18Z</dc:date>
    </item>
  </channel>
</rss>

