Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Preset memory to zero?

smedvedoff
Beginner
680 Views

Is there a way to force memory to be preset to zero using IVF? We have some legacy Fortran code that was being built with CVF; it relies on memory being preset to zero (many variables are not explicitly initialized). When we build it using IVF, which apparently doesn't preset memory to zero, we get a slew of runtime errors, as you would expect. Ultimately the code should be corrected so that all variables are initialized, but in the meantime, is there something we can do?

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
680 Views
/Qzero[-] enable/disable(DEFAULT) implicit initialization to zero of local
scalar variables of intrinsic type INTEGER, REAL, COMPLEX,
or LOGICAL that are not saved or initialized
/Qnobss-init disable placement of zero-initialized vars in BSS (use DATA)
This will not handle wipe of allocated memory
Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
680 Views
/Qzero /Qsave should help. You need to use /Qsave. CVF did not initialize to zero but it did apply SAVE semantics by default which might make it look as if it zero-initialized.
0 Kudos
smedvedoff
Beginner
680 Views

Jim and Steve -

Thanks for the help.

- Steve

0 Kudos
Reply