<?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: Alignment issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274203#M656766</link>
    <description>Yes, I am using A.06.00&lt;BR /&gt;&lt;BR /&gt;Thank you very much Dennis</description>
    <pubDate>Thu, 17 Feb 2011 22:52:04 GMT</pubDate>
    <dc:creator>bradm_1</dc:creator>
    <dc:date>2011-02-17T22:52:04Z</dc:date>
    <item>
      <title>Alignment issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274201#M656764</link>
      <description>&lt;!--!*#--&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I've run into what appears to be a bug in the compiler on HP 11.23.&lt;BR /&gt;&lt;BR /&gt;The following program receives BUS_ADRALN - Invalid address alignment:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;typedef struct S1&lt;BR /&gt;{&lt;BR /&gt;   int    val;&lt;BR /&gt;} S1;&lt;BR /&gt;&lt;BR /&gt;static S1    *s;&lt;BR /&gt;static char  buff[32];&lt;BR /&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;   int      work;&lt;BR /&gt;   &lt;BR /&gt;   s = (S1 *)&amp;amp;buff[2];&lt;BR /&gt;   &lt;BR /&gt;   s-&amp;gt;val = 5;&lt;BR /&gt;   &lt;BR /&gt;   work = s-&amp;gt;val;&lt;BR /&gt;   work += 2;&lt;BR /&gt;   s-&amp;gt;val = work;&lt;BR /&gt;   &lt;BR /&gt;   printf("1. val=%d\n", s-&amp;gt;val);&lt;BR /&gt;   &lt;BR /&gt;   s-&amp;gt;val += 2;&lt;BR /&gt;   &lt;BR /&gt;   printf("2. val=%d\n", s-&amp;gt;val);&lt;BR /&gt;   &lt;BR /&gt;   return (0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;As expected, it crashes on the first reference to s-&amp;gt;val since it is not on a four byte boundary.&lt;BR /&gt;&lt;BR /&gt;I recompiled with +u1 and it gets past the first part okay, however it still crashes on the line that adds a value to s-&amp;gt;val:&lt;BR /&gt;&lt;BR /&gt;   s-&amp;gt;val += 2;&lt;BR /&gt;&lt;BR /&gt;I produced an assembly listing and saw that a series of st1 and ld1 instructions were substituted for the st4 and ld4 to fix the initial problem however the line that adds 2 to the s-&amp;gt;val is still using st4 and ld4 to move the value between memory and a register which is causing the crash.&lt;BR /&gt;&lt;BR /&gt;Does anyone have any insight to this?  Is it a reported problem?   Am I doing something wrong?&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 17 Feb 2011 20:31:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274201#M656764</guid>
      <dc:creator>bradm_1</dc:creator>
      <dc:date>2011-02-17T20:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Alignment issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274202#M656765</link>
      <description>&amp;gt;a bug in the compiler on HP 11.23.&lt;BR /&gt;&lt;BR /&gt;What version?&lt;BR /&gt;This works on obsolete aCC5, A.05.50 and also OK on the latest A.06.25.02.&lt;BR /&gt;&lt;BR /&gt;But it does fail on A.06.00 through A.06.02.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Am I doing something wrong?&lt;BR /&gt;&lt;BR /&gt;You are using an obsolete compiler.  You need to upgrade.</description>
      <pubDate>Thu, 17 Feb 2011 22:00:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274202#M656765</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-17T22:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Alignment issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274203#M656766</link>
      <description>Yes, I am using A.06.00&lt;BR /&gt;&lt;BR /&gt;Thank you very much Dennis</description>
      <pubDate>Thu, 17 Feb 2011 22:52:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274203#M656766</guid>
      <dc:creator>bradm_1</dc:creator>
      <dc:date>2011-02-17T22:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alignment issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274204#M656767</link>
      <description>Dennis Handly confirmed that this was an issue with an older compiler.</description>
      <pubDate>Thu, 17 Feb 2011 23:17:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/alignment-issue/m-p/5274204#M656767</guid>
      <dc:creator>bradm_1</dc:creator>
      <dc:date>2011-02-17T23:17:03Z</dc:date>
    </item>
  </channel>
</rss>

