<?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: Floating point problems when using /ARCH=HOST in PASCAL compile in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505524#M31986</link>
    <description>Having examined the generated code, I don't think this was actually a Pascal bug, but rather a GEM (code generator) bug. No practical difference for the user, but since "genuine" Pascal compiler bugs are so rare, I'm just keeping the score correct ;-)&lt;BR /&gt;&lt;BR /&gt;It looks like something to do with use of the relatively recent ITOFF instruction in the code sequence to fix misaligned data. Since it's an architecture specific instruction, that's why it was affected by the /ARCH= qualifier.&lt;BR /&gt;&lt;BR /&gt;The new compiler doesn't use ITOFF at all.&lt;BR /&gt;&lt;BR /&gt;It's also worth noting that the /USAGE=PERFORMANCE qualifier on this code causes the compiler to generate many&lt;BR /&gt;&lt;BR /&gt;%PASCAL-I-COMNOTALN, Component is not optimally aligned&lt;BR /&gt;&lt;BR /&gt;messages, pointing out the declarations and references to unaligned variables and fields. Well worth using to check your code.</description>
    <pubDate>Tue, 22 Mar 2005 19:30:28 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2005-03-22T19:30:28Z</dc:date>
    <item>
      <title>Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505512#M31974</link>
      <description>OpenVMS 7.3-2&lt;BR /&gt;Pascal 5.8-92&lt;BR /&gt;&lt;BR /&gt;Recently we tried to use the /ARCHITECTURE=HOST qualifier on our PASCAL program compiles, but have run into a problem with one of our subroutines.&lt;BR /&gt;&lt;BR /&gt;A number of problems have been encountered,&lt;BR /&gt;- depending on how a couple of real variables are initialised, the program may crash at run-time with a SYSTEM-F-FLTINV error&lt;BR /&gt;- when I get past this problem, I see an add operation between 2 reals that only works correctly the first time&lt;BR /&gt;- a "&amp;lt;" comparison between 2 reals does not work correctly&lt;BR /&gt;&lt;BR /&gt;Removing the /ARCHITECT qualifier fixes these problems.&lt;BR /&gt;&lt;BR /&gt;I am working on a test case and will most likely log a call with support, but wondered if there is any known issues out there that might help.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 16 Mar 2005 00:54:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505512#M31974</guid>
      <dc:creator>Chris Barratt</dc:creator>
      <dc:date>2005-03-16T00:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505513#M31975</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;  Please log a case so we can work out if this is an application or compiler issue. Post source code with your case.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2005 14:16:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505513#M31975</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-03-16T14:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505514#M31976</link>
      <description>I have my test case ready now, but will not be able to log a call until next Monday.&lt;BR /&gt;In the meantime, I have attached a ZIP file with the test case components in it.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;chris&lt;BR /&gt;&lt;BR /&gt;P.S. Is there a way to log call electronically ?&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 00:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505514#M31976</guid>
      <dc:creator>Chris Barratt</dc:creator>
      <dc:date>2005-03-17T00:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505515#M31977</link>
      <description>Chris,&lt;BR /&gt;  Please send me mail.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2005 15:00:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505515#M31977</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-03-17T15:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505516#M31978</link>
      <description>Cris,&lt;BR /&gt; you may be able to log a call via Support Case Manager&lt;BR /&gt;&lt;A href="http://www5.itrc.hp.com/service/mcm/homepageRequest.do" target="_blank"&gt;http://www5.itrc.hp.com/service/mcm/homepageRequest.do&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Mar 2005 17:46:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505516#M31978</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-03-19T17:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505517#M31979</link>
      <description>What Alpha machine are you using?  Do a&lt;BR /&gt;&lt;BR /&gt;$ write sys$output f$getsyi("hw_name")&lt;BR /&gt;&lt;BR /&gt;and post the results.&lt;BR /&gt;&lt;BR /&gt;The /ARCH=HOST qualifier allows the code generator to use instructions available on the host machine.  By default, the compiler still uses the older "GENERIC" model which is based loosely on the EV4 instruction set.  Notably, it does not include byte and word instructions.  Using /ARCH=HOST on any modern Alpha will get you byte/word instructions and probably others.  However, it does not change floating point behavior in any notable way.  Other than new instructions to move directly between floating and integer registers, the floating instruction set for Alpha has been quite stable over the lifetime.&lt;BR /&gt;&lt;BR /&gt;I'm going to guess that with /ARCH=HOST, different instructions were used or perhaps just different registers were used which uncovered an uninitialized variable in your program.&lt;BR /&gt;&lt;BR /&gt;Have you compiled with /USAGE=ALL/CHECK=ALL?  That might help you find something.&lt;BR /&gt;&lt;BR /&gt;If you still have problems and have a small example, send it to either John Gillings or myself.  We'll be glad to help out.&lt;BR /&gt;&lt;BR /&gt;John&lt;BR /&gt;Pascal Project Leader</description>
      <pubDate>Mon, 21 Mar 2005 09:17:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505517#M31979</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2005-03-21T09:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505518#M31980</link>
      <description>Chris, &lt;BR /&gt;&lt;BR /&gt;reading your question and John's answer, the more suspicious trait in me tried to combine the two and cooked up a scenario where you did your compile on a more recent CPU, and then the run on an older CPU (of course, on both sides of the extra functionality boundery).&lt;BR /&gt;&lt;BR /&gt;Can you positively dismiss this possibility?&lt;BR /&gt;&lt;BR /&gt;Or even, John, is my logic correct, or am I seeing ghosts?&lt;BR /&gt;&lt;BR /&gt;just EUR 0.02&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;Jan</description>
      <pubDate>Mon, 21 Mar 2005 09:43:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505518#M31980</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-03-21T09:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505519#M31981</link>
      <description>Thanks John and Jan.&lt;BR /&gt;&lt;BR /&gt;Each node in our cluster (there are 3) is a COMPAQ Alphaserver DS20E 666 MHz (from f$getsyi).&lt;BR /&gt;&lt;BR /&gt;I am only compiling and running on the development machine.&lt;BR /&gt;&lt;BR /&gt;Have logged the case with John Gillings now, with a simple test case. My bet is as JR says, and it is an uninitialised variable or some such - however, the test case involved cutting down all the code in the original programs, so I thought I may have found a case like that.&lt;BR /&gt;&lt;BR /&gt;One feature of this problem that I have not commented on so far is that the problems happen within a subroutine. Any floating point stuff in the main program works fine.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chris</description>
      <pubDate>Mon, 21 Mar 2005 17:24:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505519#M31981</guid>
      <dc:creator>Chris Barratt</dc:creator>
      <dc:date>2005-03-21T17:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505520#M31982</link>
      <description>For those interested in looking at the code, UNZIP Chris's ZIP file onto an OpenVMS system and SET FILE/ATTR=RFM:VAR then edit the files and remove any junk at the end.&lt;BR /&gt;&lt;BR /&gt;ZIP still doesn't really understand OpenVMS files :-(&lt;BR /&gt;&lt;BR /&gt;The root cause appears to be a PACKED RECORD declaration. This has resulted in most of the fields in the record (Floats, quads and integers) being unaligned. I think there may be something wrong with the code Pascal is generating to fix up the alignments, but that needs to be confirmed by John Reagan. Regardless, the fix is simply to remove the word "PACKED" from the declaration. &lt;BR /&gt;&lt;BR /&gt;There is no need to pack records. On Alpha and IA64 the effect is to inhibit alignment and kill performance. In this case, the alignment costs a whole 2 bytes. Moving one field from the beginning to the end of the record would eliminate even that cost (and, besides, the additional code to deal with misaligned fields takes up a whole lot more than just 2 bytes!)&lt;BR /&gt;&lt;BR /&gt;You need to care about alignment on Alpha, and even more so on IA64. In Pascal, compile your code with /LIST/SHOW=STRUCT, then SEARCH the LISting file for "Align" this will show any record fields that the compiler has identified as misaligned.&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2005 21:33:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505520#M31982</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-03-21T21:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505521#M31983</link>
      <description>JohnG and I have exchanged some private email.  While his observation that removing PACKED helps, using PACKED should never get the wrong answer.  PACKED should only result in smaller data structures and probably additional code to access the poorly aligned data.  Since the compiler knows the fields are poorly aligned, it should not generate code that gets alignment faults in case you asked yourself that question.&lt;BR /&gt;&lt;BR /&gt;I've downloaded the .ZIP file and will look closer at it today based on some information that JohnG sent me.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2005 09:52:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505521#M31983</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2005-03-22T09:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505522#M31984</link>
      <description>Unpacking the .ZIP file, I noticed a few things.&lt;BR /&gt;&lt;BR /&gt;1) With the latest V5.9-95 compiler, I don't get the floating error on the 3rd case.  It produces output that is ALMOST the same as the case with the default qualifiers.&lt;BR /&gt;&lt;BR /&gt;2) Using /NOOPT, I get exactly the same output with the "default" case and the "/ARCH=HOST" case.  Could still be a compiler bug or a program-bug.  I'm about to dive into the debugger and figure it out.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2005 10:05:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505522#M31984</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2005-03-22T10:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505523#M31985</link>
      <description>OK, it seems to be a compiler bug that has been fixed.&lt;BR /&gt;&lt;BR /&gt;With the new V5.9-95 compiler (should be available on the latest Alpha LP CDs) gets the same answer for the "default" case, the "/ARCH=HOST" case and the "/ARCH=HOST and initialized lo_elapsed" case (well the initialized lo_elapsed case is slightly different since lo_elapsed now has the lower value).&lt;BR /&gt;&lt;BR /&gt;I'll contact Chris via email to see if he wants a hot kit in case he doesn't have the CDROMs yet.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2005 10:15:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505523#M31985</guid>
      <dc:creator>John Reagan</dc:creator>
      <dc:date>2005-03-22T10:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point problems when using /ARCH=HOST in PASCAL compile</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505524#M31986</link>
      <description>Having examined the generated code, I don't think this was actually a Pascal bug, but rather a GEM (code generator) bug. No practical difference for the user, but since "genuine" Pascal compiler bugs are so rare, I'm just keeping the score correct ;-)&lt;BR /&gt;&lt;BR /&gt;It looks like something to do with use of the relatively recent ITOFF instruction in the code sequence to fix misaligned data. Since it's an architecture specific instruction, that's why it was affected by the /ARCH= qualifier.&lt;BR /&gt;&lt;BR /&gt;The new compiler doesn't use ITOFF at all.&lt;BR /&gt;&lt;BR /&gt;It's also worth noting that the /USAGE=PERFORMANCE qualifier on this code causes the compiler to generate many&lt;BR /&gt;&lt;BR /&gt;%PASCAL-I-COMNOTALN, Component is not optimally aligned&lt;BR /&gt;&lt;BR /&gt;messages, pointing out the declarations and references to unaligned variables and fields. Well worth using to check your code.</description>
      <pubDate>Tue, 22 Mar 2005 19:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/floating-point-problems-when-using-arch-host-in-pascal-compile/m-p/3505524#M31986</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-03-22T19:30:28Z</dc:date>
    </item>
  </channel>
</rss>

