<?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>S32 Design StudioのトピックBug in powerpc-eabivle-gcc-4.9.2</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682555#M1459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When compiling (-O2) the following code (file attached: bug.c):&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;inttypes.h&amp;gt;

typedef struct Bar { uint8_t value; } Bar;
void make_bar( Bar* bar, uint32_t code ) { bar-&amp;gt;value = (code &amp;gt;&amp;gt; 12) &amp;amp; 0x7f; }

uint32_t
foo( uint32_t code )
{
&amp;nbsp; if ((code &amp;amp; 0xfe000001) == 0x70000001)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Bar bar;
&amp;nbsp;&amp;nbsp;&amp;nbsp; make_bar(&amp;amp;bar, code);
&amp;nbsp;&amp;nbsp;&amp;nbsp; return bar.value;
&amp;nbsp; }
&amp;nbsp; return 0;
}&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The generated assembly for foo is:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;00000008 &amp;lt;foo&amp;gt;:
&amp;nbsp;&amp;nbsp; 8:&amp;nbsp;&amp;nbsp; 74 67 07 cd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rlwinm r7,r3,0,31,6
&amp;nbsp;&amp;nbsp; c:&amp;nbsp;&amp;nbsp; 74 69 a6 6f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rlwinm r9,r3,20,25,23
&amp;nbsp; 10:&amp;nbsp;&amp;nbsp; 71 40 00 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_li&amp;nbsp;&amp;nbsp;&amp;nbsp; r10,0
&amp;nbsp; 14:&amp;nbsp;&amp;nbsp; 70 6e e0 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_lis&amp;nbsp;&amp;nbsp; r3,28672
&amp;nbsp; 18:&amp;nbsp;&amp;nbsp; 65 f3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_bseti r3,31
&amp;nbsp; 1a:&amp;nbsp;&amp;nbsp; 0c 37&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_cmp&amp;nbsp; r7,r3
&amp;nbsp; 1c:&amp;nbsp;&amp;nbsp; 7c 69 50 9e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iseleq&amp;nbsp; r3,r9,r10
&amp;nbsp; 20:&amp;nbsp;&amp;nbsp; 00 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_blr&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "e_rlwinm r9,r3,20,25,23" is obviously faulty; should be "e_rlwinm r9,r3,20,25,31".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus when given 0x70004001, foo returns 0x00170004 whereas it should return 4.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338642" rel="nofollow noopener noreferrer" target="_blank"&gt;bug.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jun 2017 09:37:12 GMT</pubDate>
    <dc:creator>yveslhuillier</dc:creator>
    <dc:date>2017-06-10T09:37:12Z</dc:date>
    <item>
      <title>Bug in powerpc-eabivle-gcc-4.9.2</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682555#M1459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When compiling (-O2) the following code (file attached: bug.c):&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;inttypes.h&amp;gt;

typedef struct Bar { uint8_t value; } Bar;
void make_bar( Bar* bar, uint32_t code ) { bar-&amp;gt;value = (code &amp;gt;&amp;gt; 12) &amp;amp; 0x7f; }

uint32_t
foo( uint32_t code )
{
&amp;nbsp; if ((code &amp;amp; 0xfe000001) == 0x70000001)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Bar bar;
&amp;nbsp;&amp;nbsp;&amp;nbsp; make_bar(&amp;amp;bar, code);
&amp;nbsp;&amp;nbsp;&amp;nbsp; return bar.value;
&amp;nbsp; }
&amp;nbsp; return 0;
}&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The generated assembly for foo is:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;00000008 &amp;lt;foo&amp;gt;:
&amp;nbsp;&amp;nbsp; 8:&amp;nbsp;&amp;nbsp; 74 67 07 cd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rlwinm r7,r3,0,31,6
&amp;nbsp;&amp;nbsp; c:&amp;nbsp;&amp;nbsp; 74 69 a6 6f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rlwinm r9,r3,20,25,23
&amp;nbsp; 10:&amp;nbsp;&amp;nbsp; 71 40 00 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_li&amp;nbsp;&amp;nbsp;&amp;nbsp; r10,0
&amp;nbsp; 14:&amp;nbsp;&amp;nbsp; 70 6e e0 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_lis&amp;nbsp;&amp;nbsp; r3,28672
&amp;nbsp; 18:&amp;nbsp;&amp;nbsp; 65 f3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_bseti r3,31
&amp;nbsp; 1a:&amp;nbsp;&amp;nbsp; 0c 37&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_cmp&amp;nbsp; r7,r3
&amp;nbsp; 1c:&amp;nbsp;&amp;nbsp; 7c 69 50 9e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iseleq&amp;nbsp; r3,r9,r10
&amp;nbsp; 20:&amp;nbsp;&amp;nbsp; 00 04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; se_blr&lt;/PRE&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "e_rlwinm r9,r3,20,25,23" is obviously faulty; should be "e_rlwinm r9,r3,20,25,31".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus when given 0x70004001, foo returns 0x00170004 whereas it should return 4.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338642" rel="nofollow noopener noreferrer" target="_blank"&gt;bug.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2017 09:37:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682555#M1459</guid>
      <dc:creator>yveslhuillier</dc:creator>
      <dc:date>2017-06-10T09:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in powerpc-eabivle-gcc-4.9.2</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682556#M1460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not a solution to the problem, but for the NXP guys, why not put the compiler GitHub where people can properly report issues and help fix them? It's clear that this side of the business is new to 'open development', but releasing a blob of your source is literally the least you can (and need to) do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You already have the space for it and it's not being used for much of anything:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/NXP" title="https://github.com/NXP"&gt;NXP · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jun 2017 15:03:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682556#M1460</guid>
      <dc:creator>jfrey</dc:creator>
      <dc:date>2017-06-12T15:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in powerpc-eabivle-gcc-4.9.2</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682557#M1461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yves,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I had found the same problem as you (&lt;A href="https://community.nxp.com/thread/450328"&gt;Value Comparison Giving the Wrong Result&lt;/A&gt;) &amp;nbsp;and the response I got was that it is fixed in the next version of the compiler which is due for release on the 16 June 2017. &amp;nbsp;As a workaround I am compiling&amp;nbsp;the file with the problematic code with the optimisations turned off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 01:31:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682557#M1461</guid>
      <dc:creator>peterb2</dc:creator>
      <dc:date>2017-06-13T01:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in powerpc-eabivle-gcc-4.9.2</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682558#M1462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yves,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your report and sorry about the delay. Currently we have some support staff out-of-office.&lt;/P&gt;&lt;P&gt;Anyway, I can confirm this is indeed a known issue which should be fixed in the next release (v1.2)&lt;/P&gt;&lt;P&gt;I've tried to build and disassemble your snippet using the compiler version from v1.2 and the rotation instruction is ok now:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;foo:
000040c8: e_rlwinm r6,r3,0,31,6
000040cc: e_rlwinm r7,r3,20,25,31
000040d0: e_lis r3,28672
000040d4: se_bseti r3,31
000040d6: se_cmp r6,r3
000040d8: se_li r6,0
000040da: iseleq r3,r7,r6
000040de: se_blr‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S32DS Power v1.2 should be released at the end of this week 16-June-2017.&lt;/P&gt;&lt;P&gt;It will be announced on the S32 Design Studio community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 16:15:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Bug-in-powerpc-eabivle-gcc-4-9-2/m-p/682558#M1462</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-06-14T16:15:23Z</dc:date>
    </item>
  </channel>
</rss>

