[J3] Question about what some processors do

Robert Corbett rpcorbett at att.net
Fri Oct 22 01:45:11 UTC 2021


The Sun/Oracle compiler normally
would put a copy of the value of the
named constant in the generated
object file.  It would also produce
debugging information for the
named constant.  It would not
include information about the
named constant in the module
file.

Is the size of the value of the named
constant large enough to matter on
a modern machine?  Note that a
large constant value that is never
referenced is unlikely to be swapped
into physical memory.

Bob Corbett

> On Oct 21, 2021, at 5:16 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> 
> If a named constant in a module is private, and its only use is in one assignment statement that assigns a value to a component of a structure in another named constant declaration, or as a data-stmt-value, does the processor produce the first constant in the object file?
> 
> I'm curious about this because I have a derived type with 18 array components with extents given by length parameters (and eleven scalars). Values are created by another program that generates named constants for values for the components, and then uses them in a type constructor to create another named constant for the derived-type object.
> 
> If processors retain the intermediary named constants, I will eventually use a giant type constructor that avoids the intermediary named constants, when processors support the essentially-unlimited statement length in the next standard. If not, I won't need to change my code generator.
> 



More information about the J3 mailing list