Patch Name: PHSS_8498 Patch Description: s700_800 10.X cumulative Fortran77 patch Creation Date: 96/10/03 Post Date: 96/12/06 Hardware Platforms - OS Releases: s700: 10.00 10.01 10.10 10.20 s800: 10.00 10.01 10.10 10.20 Products: FORTRAN B.10.01 B.10.03.10 Auxiliary-Opt B.10.01 B.10.03.10 Filesets: FORTRAN.FORTRAN-PRG,B.10.01,B.10.03.10,B.10.20.00 FORTRAN.FORTRAN-RELNOTES,B.10.01,B.10.03.10,B.10.20.00 Auxiliary-Opt.LANG-AUX,B.10.01,B.10.03.10,B.10.20.00 Auxiliary-Opt.LANG-SMP,B.10.01,B.10.03.10,B.10.20.00 Automatic Reboot?: No Status: General Superseded Critical: No Path Name: /hp-ux_patches/s700_800/10.X/PHSS_8498 Symptoms: PHSS_8498: 1. When compiling certain complex loops with +O2 optimization, the compiler dies with a signal 11 (segmentation violation). An example of such a loop is in the following subroutine: SUBROUTINE sub 999 CALL sub1 CALL sub2 (1,*1000) CALL sub3 (*999) GOTO 999 1000 CALL sub4 (1) GOTO 999 END Note that control leaves the loop based on alternate returns from subroutine calls. 2. If two different sized arrays are equivalenced together and only the smaller array is referenced, it is possible that not enough memory will be allocated to hold the larger array. This can result in incorrect results, or a runtime failure, when the smaller array is indexed past its bounds (but still within the bounds of the larger array). This can occur with +O3 and -K. 3. A compilation with +O4 +Oall +Owhole_program_mode may fail with a fatal error in certain unusual cases where addresses of user routines are passed as arguments and the routines are completely cloned and inlined. 4. Compilation of a subprogram with +O2 and -K can fail with signal 11 if the subprogram contains an expression where a parameter variable is negated. 5. Compilation of some program units with the options +O2 +DA2.0 +DS2.0 may case a fatal error. Reducing the optimization level to +O1 eliminates the failure. 6. Different results when compiled with +O1 verses +O2/+O3/+O4. PHSS_7647: 1. You may have this problem if you use multiple entry points and see this assert: Backend Assert ** no corresponding FPAR for this parameter. (5172) 2. Optimizer may abort on programs with switch statements and with +Z and PBO. 3. Bad code for bit fields in static struct address % 4 is 2 4. C compiler very slow with +O1, infinite loop in value numbering 5. +O1 build of module gets into infinite loop in value numbering PHSS_7364: 1. Some valid key value expressions for keyed reads of ISAM files may cause a compiler error. The known types of expressions that cause this problem are subscripted array variables and function calls, as in: integer*4 keyval(10) read (10, key=keyval(5)) or integer*4 getkeyval ! getkeyval is a function read (10, key=getkeyval()) For the subscripted array the error may be: Error on line 4 of orig.f: wrong number of subscripts on keyval For this and other cases the reported error can vary and may not appear to be related to the read statement. It is possible that key value expressions of other sorts may also trigger this defect. PHSS_7210: 1. When +O3 +Onolimit you may see the message "Memory fault(coredump)". The problem goes away if +Onoloop_transform is used. 2. Optimizer may abort at +O3 +Oreg_reassoc for codes with nested loops. 3. Bad error number (7816) when out of memory. PHSS_6728: 1. Some statement functions which contain an intrinsic function call may cause the compiler to issue an error if the statement function is never used and IMPLICIT None is in effect. The error is: Declaration error on/above line 6 of test.f; for ishft; attempt to use undefined variable 2. Labels on a source line number greater than 65535 may not be handled correctly. a) If there is a label on a line with line number of the form (65536*n), an inappropriate error of the form: Error on line 70596 of t.f: missing statement number 2 will be reported. b) Another symptom of the defect is messages that reference incorrect line numbers, as in: Warning on line 65549 of t.f: jump into block at line 8 of t.f Here the "block at line 8" reference should be "block at line 65584". The line number is incorrectly reported as (lineno MOD 65536). 3. With xdb, you can't display a dynamically allocated array variable in a program compiled with the f77 option -K (or +e, which implies -K). Attempting to print the variable "tab" in the following program demonstrates the problem: allocatable tab(:) integer tab integer i i=5 allocate(tab(300)) tab(1)=i deallocate(tab) end 4. When an element of a dynamically allocated array of structures is passed as an argument, the passed pointer always points to the first element of the array instead of to the correct element. 5. A reference to an array of records that is nested in another array of records will, if passed as an argument, access an incorrect location in the outer array. Code example: foo(rec1_array(i).rec2_array) (Already fixed in release B.10.03.10) 6. Incorrect data is displayed by the xdb or dde debuggers for shared common variables. (Already fixed in release B.10.03.10) 7. Incorrect data is displayed by the xdb or dde debuggers for parameters declared as CHARACTER*(*). Code example: CHARACTER*(*) STR1 PARAMETER (STR1 = 'HELLO') 8. In some cases, errors are not diagnosed when a name that is used as a formal argument has declarations that are imcompatible with the name's being a formal argument. 9. All symbols in the main program become invisible to SoftStatic when the +ppu option is used. 10. Incorrect results when compiling with +O2 or +Opipeline. PHSS_5795: 1. Program runs out of stack space when certain compiler options, such as +DA and +DS, are used. The same defect could also, in theory, result in incorrect behavior, and need not be associated with these particular compiler options. As far as is known, this defect was never visible in a released version of the Fortran compiler. 2. Compiler fails with an error similar to: ucomp: couldn't open the message catalog "/usr/lib/nls/C/cc.cat". ucomp: PA7100, line -1, warning 6061. ucomp: /tmp/_28_8654uupdate.o, line -1, error 5209. when using +O4 or profile-based optimization together with +DA or +DS, and many .o files. 3. The compiler fails while optimizing multiple nested loops. 4. When compiling with +O4 or using profile-based optimization and some modules use +Onolimit, the compiler runs out of memory. 5. Incorrect results involving Cray pointers and the +O3 and +Oparallel options. See code example below under Defect Description. 6. Incorrect results when a Cray pointer is passed to a subprogram compiled with optimization of +O2 or higher. May also occur with automatic variables passed to subprograms. The value of the variable (Cray pointer variable or automatic variable) as seen by the subprogram may be incorrect. 7. Excessive memory use when compiling, possibly leading to running out of resources, when using +O4 or profile-based optimization and many modules. 8. Compilation at +O3 fails with error: Compiler error line 705 of test.f: Backend Assert ** Cause of inconsistency unknown. (5172) The problem involves complicated logical expressions. See code example below under Defect Description. 9. Incorrect results with +O3 and updates through a pointer. Might affect some programs that use Cray pointers. 10. Loops may be incorrectly parallelized with +O3 +Oparallel. 11. Shared common variables are incorrectly initialized with +O3 +Oparallel. 12. Incorrect results or crash at runtime with +O3 +Oparallel and field references in loop control logic. 13. Incorrect results with +O4 and inlining of some subprogram calls inside loops. 14. Incorrect results with +O4 and the $OPTION ONETRIP ON directive. 15. Program gets incorrect results or crashes when loops are compiled with +Oparallel/PBO. 16. Incorrect results or program crash when using a shared common variable with +O3. 17. Incorrect results with +O4 and subprograms that modify common variables. 18. Program may fail with PBO, +O3, +Ovectorize, and +Oparallel. 19. Programs with loops may give incorrect results or abort at runtime with SIGSEGV with +Oparallel and +O3 or higher optimization. The defect occurs when one of the loop bounds is an array reference to an array element that is also modified in the loop. See description below for a code example. Defect Description: PHSS_8498: 1. The defect was due to incorrect handling of some loops by the optimizer component of the compiler. (SR 1653181008). 2. The defect is due to incorrect handling of overlaid arrays by the high level optimizer. (No SR) 3. The defect is due to incorrect handling of the case where address-exposed subprograms have been completely inlined, including all indirect calls. (No SR) PHSS_7647: 1. HLO emits bad ucode: in a multiple entry routine, HLO's ucode referes to an FPAR after another entry has been emitted. Problem arises because shadow variable initializations are sunk out of an entry block. Fix is to consider instructions in entry blocks of multiple entry routines that have inputs which are formal bindings or promoted formal bindings to be unsinkable. (SR 1653169896) 2. Optimizer may abort on programs with switch statements and with +Z and PBO. (no SR) 3. Bad code for bit fields in static struct address % 4 is 2 (no SR) 4. C compiler very slow with +O1, infinite loop in value numbering (no SR) 5. +O1 build of module gets into infinite loop in value numbering (no SR) PHSS_7364: 1. The defect is caused by incorrect management of dynamically allocated memory by the compiler. (SR 5003312769) PHSS_7210: 1. The problem happens when we try to do a loop interchange. (SR 1653161992) 2. Optimizer may abort at +O3 +Oreg_reassoc for codes with nested loops. (SR 5003296400) 3. Bad error number (7816) when out of memory. (no SR). PHSS_6728: 1. The error should not have been issued since the name "ishft" is being used in the statement function to call an intrinsic function. (SR 5003301135) 2. NOTE: This defect does not result in generation of incorrect code. (SR 1653150524) 3. This defect was caused by the compiler generating incorrect symbol table information. (SR 1653107581) 4. The Fortran front end generated incorrect address information for this case. The problem applies only to arrays of structures, and only when the array is dynamically allocated (that is, size is not known at compile time) (SR 5003286195). 5. The same problem occurs for Fortran 90 derived types as well as for the VAX structures shown in the code example. The problem does not occur if the inner array reference has an index, as in: foo(rec1_array(i).rec2_array(1)) (SR 5003270082) 6. The debuggers show garbage values when asked to print the values of variables located in shared common. This patch will fix the problem for xdb, but an independent dde defect prevents this fix from removing the problem with dde. (SR 5003274688) 7. The problem occurs only when the parameter is declared in a type statement and the length is '*'. (SR 1653133983) 8. For example, a formal argument can not be a SAVE variable, but no error is diagnosed in: subroutine sub1 real x save x return entry sub1a(x) end Failure to diagnose such errors can occur for subroutine, function, and alternate entry point arguments, and in some cases also for main program arguments. (SR 1653126821) 9. The compiler option +ppu causes incorrect static analysis information to be placed in the object file. (SR 1653131185) 10. The optimizer may not do software pipelining of some loops correctly due to faulty dependency analysis. (SR 1653148445, 1653152793) PHSS_5795: 1. The defect is due to an uninitialized variable in the compiler front end. The exact symptoms and whether the defect occurs depend on the details of memory allocation while the compiler is running. As noted above under symptoms, as far as is known, this defect was never visible in a released version of the Fortran compiler. (no SR). 2. A file descriptor leak in the processing of +DA and +DS causes the compiler to run out of file descriptors (kernel parameter "maxfiles"). This defect was reported for the C compiler but can probably occur with Fortran. (SR 5003270843). 3. An internal software pipelining defect causes this failure. The error will not occur if the +Onopipeline compiler switch is used. (no SR). 4. Object modules produced with +O4 or profile-based optimization produces a special form of object file (an ISOM). ISOMs are not fully compiled until the link phase. The defect causes all subsequent ISOMs to be compiled with +Onolimit once the first ISOM is encountered that was compiled with +Onolimit. (no SR). 5. When compiled with +O3 and +Oparallel, the following program prints the incorrect value for "x". program rat common pool integer*4 pool, y, x integer*4 ptr_y pointer (ptr_y, y) ptr_y = loc(pool) y = 12 x = pool print *,x, pool end (no SR). 6. This is due to incorrect optimization of variables that are internally represented by pointers. (no SR). 7. +O4 compilation and profile-based optimization result in special object modules (ISOMs) that are further compiled at link time. A memory leak fails to free some memory for each ISOM seen in the link phase. (no SR). 8. Some expressions matching DeMorgan's law (not (A and B) <==> not A or not B) and having a constant operand (after constant propagation, in this case) can not be handled by the optimizer. (no SR). IVON01 = 1 LCTNT1 = .FALSE. LCTNT2 = .TRUE. IF(.NOT.(LCTNT1.OR.LCTNT2).AND..NOT.(LCTNT1.AND. * LCTNT2)) IVON01 = 0 9. This defect was reported for the C language but might affect Fortran programs. Cray pointers that can point to different variables, depending on control flow, man not be optimized correctly. (no SR). 10. This defect was reported for the C language but might also affect Fortran programs. (SR 4701294975). 11. This defect was reported for the C language but might also affect Fortran programs. The C defect concerned static arrays of strings, which don't correspond directly to a construct in Fortran. The uses of shared common that are a problem are generated by the compiler when parallelizing the program. (SR 4701294967). 12. This defect was reported for the C language but might also affect Fortran programs. (SR 4701293720). 13. This defect was reported for the C language but might also affect Fortran programs. (no SR). 14. The following loop should execute once, but incorrect optimization causes it not to be executed (no SR): $ OPTION ONETRIP ON J = 0 DO 10, I = 1, -1 J = J + 1 10 CONTINUE 15. If the loop contains many variables and/or the program is compiled for many processors, some of the variables may not be addressed correctly. (no SR). 16. An incorrect load instruction may be generated accessing a shared common variable. (no SR). 17. This defect was reported for the C language, but it may affect Fortran programs. Calls that modify common variables may be improperly reordered. (no SR). 18. Vectorization of some loops may not be correct. (no SR). 19. This problem may occur even when +Oinfo does not report that any loops were parallelized. Example: M(3) = 1 DO I = M(3), 100 M(I) = 10 ENDDO (SR 4701293324). SR: 5003270843 4701293324 4701294967 4701293720 4701294975 5003301135 1653150524 1653107581 5003286195 5003270082 5003274688 1653133983 1653126821 1653131185 1653148445 1653152793 1653161992 5003296400 5003312769 1653169896 1653181008 1653187351 1653182287 Patch Files: /opt/fortran/lbin/f77pass1 /opt/fortran/bin/f77 /opt/fortran/lib/nls/msg/C/f77pass1.cat /opt/fortran/lib/nls/msg/C/f77.cat /opt/langtools/lbin/ucomp.tmp /opt/langtools/lib/nls/msg/C/ucomp.cat.tmp /opt/langtools/lib/libp/libmp.a.tmp /opt/langtools/lib/libmp.a.tmp /opt/fortran/newconfig/doc.PHSS_5795 /opt/fortran/newconfig/doc.10.01 /opt/fortran/newconfig/doc.10.01.ps /opt/fortran/newconfig/doc.10.10 /opt/fortran/newconfig/doc.10.10.ps /opt/fortran/newconfig/doc.10.20 /opt/fortran/newconfig/doc.10.20.ps /opt/fortran/newconfig/RelNotes/Fortran.10.10 /opt/fortran/newconfig/RelNotes/Fortran.10.20 /opt/fortran/newconfig/RelNotes/Fortran.10.01 what(1) Output: /opt/fortran/lbin/f77pass1: HP-UX SLLIC/OPTIMIZER UX.10.20.370 (DAVIS): 11/05/96 Ucode Code Generator - UX.10.20.09 (BCK_UX10.MULTI_B L14) HP-UX f77pass1 961119 (164929) B3906AA/B3908AA PHSS _8498 B.10.20.06 High Level Optimizer - UX.10.20.961010 (MULTI) [-DHL O_RELEASE +O3] - 19-Nov-96.13:07 /usr/lib/libc: $Revision: 76.3 $ /opt/fortran/lib/nls/msg/C/f77pass1.cat: None /opt/fortran/bin/f77: HP-UX f77 961119 (172618) B3906AA/B3908AA PHSS_8498 B.10.20.06 /usr/lib/libc: $Revision: 76.3 $ /opt/fortran/lib/nls/msg/C/f77.cat: None /opt/langtools/lib/libp/libmp.a.tmp: Parallel Runtime Library - UX.10.20.960329 (DAVIS) [ +O4] - 29-Oct-96.18:34 /opt/langtools/lib/libmp.a.tmp: Parallel Runtime Library - UX.10.20.960329 (DAVIS) [ +O4] - 29-Oct-96.18:34 /opt/langtools/lbin/ucomp.tmp: HP-UX UCOMP UX.10.20.128 (DAVIS): 10/09/96 HP-UX UCOMP UX.10.20.128 (DAVIS): 10/09/96 HP-UX SLLIC/OPTIMIZER UX.10.20.370 (DAVIS): 11/05/96 Ucode Code Generator - UX.10.20.09 (BCK_UX10.MULTI_B L14) High Level Optimizer - UX.10.20.961010 (MULTI) [-DHL O_RELEASE +O3] - 19-Nov-96.13:07 /usr/lib/libc: $Revision: 76.3 $ /opt/langtools/lib/nls/msg/C/ucomp.cat.tmp: None /opt/fortran/newconfig/RelNotes/Fortran.10.10: None /opt/fortran/newconfig/RelNotes/Fortran.10.20: None /opt/fortran/newconfig/RelNotes/Fortran.10.01: None /opt/fortran/newconfig/doc.10.01: None /opt/fortran/newconfig/doc.10.01.ps: None /opt/fortran/newconfig/doc.10.10: None /opt/fortran/newconfig/doc.10.10.ps: None /opt/fortran/newconfig/doc.10.20: None /opt/fortran/newconfig/doc.PHSS_5795: None /opt/fortran/newconfig/doc.10.20.ps: None cksum(1) Output: 2947993309 17310 /opt/fortran/newconfig/RelNotes/ Fortran.10.10 1554184257 12112 /opt/fortran/newconfig/RelNotes/ Fortran.10.20 3848233598 17318 /opt/fortran/newconfig/RelNotes/ Fortran.10.01 431048335 28812 /opt/fortran/newconfig/doc.10.01 3713660161 166018 /opt/fortran/newconfig/doc.10.01.ps 1779136704 28871 /opt/fortran/newconfig/doc.10.10 3193514553 166831 /opt/fortran/newconfig/doc.10.10.ps 1505677078 36613 /opt/fortran/newconfig/doc.10.20 1068795986 2176 /opt/fortran/newconfig/doc.PHSS_5795 2184193837 215426 /opt/fortran/newconfig/doc.10.20.ps 1289104425 7488371 /opt/fortran/lbin/f77pass1 3299941438 7299 /opt/fortran/lib/nls/msg/C/f77.cat 3904433880 93117 /opt/fortran/lib/nls/msg/C/f77pass1.cat 1730212089 234572 /opt/fortran/bin/f77 1742826718 88484 /opt/langtools/lib/libp/libmp.a.tmp 2288211346 35513 /opt/langtools/lib/nls/msg/C/ucomp.cat.tmp 3242109367 79572 /opt/langtools/lib/libmp.a.tmp 907585979 5098867 /opt/langtools/lbin/ucomp.tmp Patch Conflicts: None Patch Dependencies: s700: 10.00 10.01 10.10: PHSS_8555 PHSS_7505 s800: 10.00 10.01 10.10: PHSS_8555 PHSS_7505 Hardware Dependencies: None Other Dependencies: None Supersedes: PHSS_5795 PHSS_6728 PHSS_7210 PHSS_7364 PHSS_7647 Equivalent Patches: None Patch Package Size: 13630 Kbytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHSS_8498 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHSS_8498.depot 5b. For a homogeneous NFS Diskless cluster run swcluster on the server to install the patch on the server and the clients: swcluster -i -b This will invoke swcluster in the interactive mode and force all clients to be shut down. WARNING: All cluster clients must be shut down prior to the patch installation. Installing the patch while the clients are booted is unsupported and can lead to serious problems. The swcluster command will invoke an swinstall session in which you must specify: alternate root path - default is /export/shared_root/OS_700 source depot path - /tmp/PHSS_8498.depot To complete the installation, select the patch by choosing "Actions -> Match What Target Has" and then "Actions -> Install" from the Menubar. 5c. For a heterogeneous NFS Diskless cluster: - run swinstall on the server as in step 5a to install the patch on the cluster server. - run swcluster on the server as in step 5b to install the patch on the cluster clients. By default swinstall will archive the original software in /var/adm/sw/patch/PHSS_8498. If you do not wish to retain a copy of the original software, you can create an empty file named /var/adm/sw/patch/PATCH_NOSAVE. Warning: If this file exists when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. It is recommended that you move the PHSS_8498.text file to /var/adm/sw/patch for future reference. To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHSS_8498.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: This patch includes the file "/opt/fortran/newconfig/doc.PHSS_5795", which documents the new +DC7200 compile line option and information about programs compiled for parallel execution that run out of memory. Includes NASTRAN SMP.