A P P E N D I X  B

Features Release History

This Appendix lists the new and changed features in this release and previous releases of the Fortran 95 compiler.

The Fortran 95 compiler, version 8.2, is a component released with Sun Studio 11.

B.1 Sun Studio 11 Fortran Release

B.2 Sun Studio 10 Fortran Release:

This release introduces -xarch=amd64 and -xtarget=opteron for compiling applications to run on 64-bit x86 platforms.

The new compiler flag -xfilebyteorder provides cross-platform support of binary I/O files.

With this release of Sun Studio, the OpenMP API for shared-memory parallelism is available on Solaris x86 platforms as well as Solaris SPARC platforms. The same functionality is now enabled on both platforms.

An OpenMP "stubs" library is provided for user's convenience. To compile an OpenMP program that calls OpenMP library functions but ignores the OpenMP pragmas, compile the program with the -openmp option and link the object files with the libompstubs.a library. For example:
% f95 omp_ignore.c -lompstubs

Linking with both libompstubs.a and the OpenMP runtime library libmtsk.so is unsupported and may result in unexpected behavior.

B.3 Sun Studio 9 Fortran Release:

This release of Sun Studio makes the Fortran 95 compiler available on Solaris OS x86 platforms. Compile with -xtarget values generic, native, 386, 486, pentium, pentium_pro, pentium3, or pentium4, to generate executables on Solaris x86 platforms. The default on x86 platforms is -xtarget=generic.

The following f95 features are not yet implemented on x86 platforms and are only available on SPARC platforms:

The following f95 command-line options are only available on x86 platforms and not on SPARC platforms: -fprecision, -fstore, -nofstore

The following f95 command-line options are only available on SPARC platforms and not on x86 platforms: -xcode, -xmemalign, -xprefetch, -xcheck, -xia, -xinterval, -xipo, -xjobs, -xlang, -xlinkopt, -xloopinfo, -xpagesize, -xprofile_ircache, -xreduction, -xvector, -depend, -openmp, -parallel, -autopar, -explicitpar, -vpara, -XlistMP.
Also, on x86 platforms -fast adds -nofstore.

Runtime performance for most applications should improve significantly with this release. For best results, compile with high optimization levels -xO4 or -xO5. At these levels the compiler may now inline contained procedures, and those with assumed-shape, allocatable, or pointer arguments.

The Fortran 2003 draft standard introduces three new intrinsics for processing command-line arguments and environment variables. These have been implemented in this release of the f95 compiler. The new intrinsics are:

Returns in command the entire command line that invoked the program.

Returns a command-line argument in value.

Return the value of an environment variable.

The following f95 command-line options are new in this release. See the Chapter 3 for details.

Allow crossfile optimization to include archive (.a) libraries. (SPARC only)

Generate indirect prefetches for a data arrays accessed indirectly. (SPARC only)

Set path mapping for profile data files. Use the -xprofile_pathmap option with the -xprofile=use option when profiling into a directory that is not the directory used when previously compiling with -xprofile=collect.

The following command-line option defaults have changed with this release of f95.

To compile with the defaults used in previous compiler releases, specify the following options explicitly:

-xarch=v8 -xmemalign=4s -xprefetch=no for 32-bit compilation
-xcode=abs64 -xprefetch=no for 64-bit compilation

The default SPARC architecture is no longer V7. Support for -xarch=v7 is limited in this Sun Studio 9 release. The new default is V8PLUS (UltraSPARC). Compiling with -xarch=v7 is treated as -xarch=v8 because the Solaris 8 OS only supports -xarch=v8 or better.

To deploy on SPARC V8 systems (for example, SPARCStation 10), compile with -xarch=v8 explicitly. The provided system libraries run on SPARC V8 architectures.

To deploy on SPARC V7 systems (for example, SPARCStation 1), compile with -xarch=v7 explicitly. The provided system libraries use the SPARC V8 instruction set. For the Sun Studio 9 release, only the Solaris 8 OS supports the SPARC V7 architecture. When a SPARC V8 instruction is encountered, the OS interprets the instruction in software. The program will run, but performance will be degraded.

The maximum number of threads for OMP_NUM_THREADS and the multitasking library has increased from 128 to 256.

This release of the Fortran 95 compiler's implementation of the OpenMP API for shared-memory parallel programming features automatic scoping of variables in parallel regions. See the OpenMP API User's Guide for details. (OpenMP is only implemented on SPARC platforms for this release.)

B.4 Sun Studio 8 Fortran Release:

The -openmp option flag has been enhanced to facilitate debugging OpenMP programs. To use dbx to debug your OpenMP application, compile with

-openmp=noopt -g

You will then be able to use dbx to breakpoint within parallel regions and display contents of variables. See Section , -openmp[={parallel|noopt|none}].

Specify -xjobs=n with -xipo and the interprocedural optimizer will invoke at most n code generator instances to compile the files listed on the command line. This option can greatly reduce the build time of large applications on a multi-cpu machine. See Section , -xjobs=n.

The ASSUME pragma is a new feature in this release of the compiler. This pragma gives hints to the compiler about conditions the programmer knows are true at some point in a procedure. This may help the compiler to do a better job optimizing the code. The programmer can also use the assertions to check the validity of the program during execution. See Section, The ASSUME Directives, and Section , -xassume_control[=keywords].

The following features appearing in the Fortran 2000 draft standard have been implemented in this release of Fortran 95 compiler. These are described in Chapter 4.

New intrinsic modules IEEE_ARITHMETIC, and IEEE_FEATURES provide support for exceptions and IEEE arithmetic in the Fortran language. See Section 4.6.2, IEEE Floating-Point Exception Handling.

The new draft standard for Fortran provides a means of referencing C language procedures and, conversely, a means of specifying that a Fortran subprogram can be referenced from a C function. It also provides a means of declaring global variables that are linked with external C variables. See Section 4.6.1, Interoperability with C Functions.

The Fortran 95 compiler now accepts the Fortran 2000 PROTECTED attribute. PROTECTED imposes limitations on the usage of module entities. Objects with the PROTECTED attribute are only definable within the module that declares them. Section 4.6.4, PROTECTED Attribute.

The compiler recognizes the ASYNCHRONOUS specifier on I/O statements:


This syntax is as proposed in the draft standard. See Section 4.6.5, Fortran 2003 Asynchronous I/O.

A number of new features enhance the Fortran 95 compiler's compatibility with legacy Fortran 77 compiler, f77. These include variable format expressions (VFE's), long identifiers, -arg=local , and the -vax compiler option. See Chapter 3 and Chapter 4.

Two new functions enable the user to specify their own error handling routine for formatted input on a logical unit. These routines are described in Section 4.7.1, I/O Error Handling Routines, and in man pages and the Fortran Library Reference.

With this release, the Fortran 95 compiler accepts a new data type, UNSIGNED, as an extension to the language. See Section 4.5, Unsigned Integers.

A new command-line option, -xpagesize, enables the running program to set the preferred stack and heap page size at program startup. See Section , -xpagesize=size.

This release introduces the new command-line option -xprofile_ircache= path, to speed up the "use" compilation phase during profile feedback. See Section , -xprofile_ircache[=path]. See also Section , -xprofile_pathmap=collect_prefix:use_prefix.

The -xknown_lib option has been enhanced to include more routines from the Basic Linear Algebra library, BLAS. See Section , -xknown_lib=library_list.

Compile and link with the new -xlinkopt flag to invoke a post-optimizer to apply a number of advanced performance optimizations on the generated binary object code at link time. See Section , -xlinkopt[={1|2|0}].

A new extension to the -xcheck option flag enables special initialization of local variables. Compiling with -xcheck=init_local initializes local variables to a value that is likely to cause an arithmetic exception if it is used before it is assigned by the program. See Section , -xcheck=keyword

B.5 Sun ONE Studio 7, Compiler Collection (Forte Developer 7) Release:

This release of the Forte Developer software replaces the f77 compiler with added functionality in the f95 compiler. The f77 command is a script that calls the f95 compiler:

the command:
    f77 options files libraries
becomes a call to the f95 compiler::
    f95 -f77=%all -ftrap=%none options files -lf77compat libraries

See Chapter 5 for details on Fortran 77 compatibilities and incompatibilities.

The new -f77 flag selects various compatibility features that enable the compiler to accept many Fortran 77 constructs and conventions that are normally incompatible with Fortran 95. See Section , -f77[=list], and Chapter 5.

The f95 compiler must assume that programs it compiles adhere to the Fortran 95 standard regarding aliasing of variables through subprogram calls, global variables, pointers, and overindexing. Many "dusty deck" legacy programs intentionally utilized aliasing techniques to get around shortcomings in early versions of the Fortran language. Use the new -xalias flag to advise the compiler about how far the program deviates from the standard and what kind of aliasing syndromes it should expect. In some cases the compiler generates correct code only when the proper -xalias suboption is specified. Programs that conform strictly to the standard will find some performance improvement by advising the compiler to be unconcerned about aliasing. See Section , -xalias[=keywords], and the chapter on Porting in the Fortran Programming Guide.

See Section 4.9, Module Files for details.

This release of the f95 compiler adds a number of new checks to the global program analysis provided by the -Xlist flag. The new -XlistMP suboption opens a new domain of static program analysis, verification of OpenMP parallelization directives. See Section , -Xlist[x], the Forte Developer OpenMP API User's Guide, and the chapter on Program Analysis and Debugging in the Fortran Programming Guide for details.

A new option, -xknown_lib=library, directs the compiler to treat references to certain known libraries as intrinsics, ignoring any user-supplied versions. This enables the compiler to perform optimizations over library calls based on its special knowledge of the library. In this release, the known library names are limited to blas, for a subset of the BLAS routines in the Sun Performance Library, and intrinsics, for ignoring explicit EXTERNAL declarations for Fortran 95 standard intrinsics and any user-supplied versions of these routines. See Section , -xknown_lib=library_list.

A new directive, !$PRAGMA IGNORE_TKR {list_of_variables}, causes the compiler to ignore the type, kind, and rank for the specified dummy argument names appearing in a generic procedure interface when resolving a specific call. Using this directive greatly simplifies writing generic interfaces for wrappers that call specific library routines based on argument type, kind, and rank. See Section, The IGNORE_TKR Directive for details.

In this f95 compiler release, runtime array subscript range checking with the -C option has been enhanced to include array conformance checking. A runtime error is produced when an array syntax statement is executed where the array sections are not conformable. See Section , -C.

Some new formatted I/O features proposed for the next Fortran standard have been implemented in this release of f95. These are the DECIMAL=, ROUND=, and IOMSG= specifiers, and they may appear in OPEN, READ, WRITE, PRINT, and INQUIRE statements. Also implemented are the DP, DC, RP, and RC edit descriptors. See Section 4.6.9, Fortran 2003 Formatted I/O Features for details.

A new option flag, -iorounding, sets the default rounding mode for formatted I/O. The modes, processor-defined or compatible, correspond to the ROUND= specifier implemented as part of the Fortran 2000 features. See Section , -iorounding[={compatible|processor-defined}].

The following flags have been removed from the f95 command line:

-db -dbl

The following f77 compiler flags have not been implemented in the f95 compiler and are also considered obsolete:

-arg=local -i2 -i4 -misalign -oldldo -r8 -vax
-xl -xvpara -xtypemap=integer:mixed

Compiling with the new -xcheck=stkovf flag adds a runtime check for stack overflow conditions on entry to subprograms. If a stack overflow is detected, a SIGSEGV segment fault is raised. Stack overflows in multithreaded applications with large arrays allocated on the stack can cause silent data corruption in neighboring thread stacks. Compile all routines with -xcheck=stkovf if stack overflow is suspected. See Section , -xcheck=keyword.

With this release, the default slave thread stack size has been increased to 4 Megabytes on SPARC V8 platforms, and 8 Megabytes on SPARC V9 platforms. See the discussion of stacks and stack sizes in the Parallelization chapter of the Fortran Programming Guide for details.

With -xipo=1 the compiler does inlining across all source files. This release adds -xipo=2 for enhanced interprocedural aliasing analysis and memory allocation and layout optimizations to imporve cache performance. See Section , -xipo[={0|1|2}].

Use the new flag -xprefetch_level=n to control the automatic insertion of prefetch instructions with -xprefetch=auto. Use requires an optimization level of -xO3 or greater and a target platform that supports prefetch (-xarch platforms v8plus, v8plusa, v8plusb, v9, v9a, v9b, generic64, or native64). See Section , -xprefetch_level={1|2|3}.

Feature histories for releases prior to Forte Developer 7 can be found in the documentation sets for those earlier releases on the http://docs.sun.com web site.