fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
ALIGN OBJECTS IN COMMON BLOCKS
[DO NOT] ALIGN [OBJECTS IN] COMMON [BLOCKS]
The command ALIGN OBJECTS IN COMMON BLOCKS instructs fpt to compute addresses in COMMON blocks so that all objects start on aligned addresses. Note that the command does NOT change the code. Padding variables are not inserted in the COMMON block to enforce the alignment. This command determines the addresses which fpt allocates to the variables, and therefore the equivalence relationships between them. Some compilers insert padding in COMMON blocks to align the variables, and this command causes fpt to compute addresses and equivalence relationships in the same way.
An aligned address is an address which is a multiple of the alignment granularity of the object, where the first address of a COMMON block, of a group of equivalenced variables, or of a structure, is address zero.
The alignment granularity of a numeric object is computed as the system granularity or the data size of the object, whichever is the smaller. The system granularity is specified by the command ALIGNMENT GRANULARITY.
For the purpose of this command, the alignment granularity of an object of type character is one byte. This differs from the computation used in the CHECK ALIGNMENT command, but conforms to the behaviour of most compilers which force alignment. However, character variables are usually accessed more efficiently if they start on aligned addresses.
The alignment granularity of objects of type RECORD is computed as the granularity of the largest object within the record.
Note that some Fortran compilers have compilation switches to force alignment of objects, and that some force alignment silently, without warning. It is important to find the behaviour of the system in use. When new code is developed, it is recommended that users do not force the alignment of objects with this command, but check the alignment of objects with the command CHECK ALIGNMENT.
Where to Use this Command
|Operating system command line||Yes|
|Configuration file, config.fsp||Yes|
|Specification (fsp) files, *.fsp||Yes|
|Interactively, to FPT> prompt||No|
|Interactive command files||No|
|Embedded in the Fortran code||No|
Alignment is not forced by default (Note that defaults may be changed in the configuration file)
In an FSP file for a Concept-32 machine. The compiler silently pads COMMON blocks to align objects within them:
%alignment granularity: 4 %align objects in common
ALIGN OBJECTS IN STRUCTURES
Copyright ©1995 to 2019 Software Validation Ltd. All rights reserved.