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.
29286 Discussions

Record alignment move from 7.1 to 8.1

ereisch
New Contributor II
519 Views

I have recently moved from the 7.1 compiler to the latest 8.1 release, but I'm having repeated segv crashes in my program from what would appear to be memory access violations caused by data alignment issues. I never had a problem with my program (which is a multi-language environment that interacts highly with shared memory) under 7.1, however I'm having problems with my common blocks when I compile under 8.1. The pertinent flags I'm passing are:
-vms -align norecords -vms -Zp4 -dyncom "list of common blocks"

I have tried numerous combinations of -align and -Zp arguments but to no avail. Since this option was not present in the 7.1 release, what was the behavior of that version with regards to aligning structures and common blocks?

TIA!

0 Kudos
3 Replies
Steven_L_Intel1
Employee
519 Views
One change was that in 7.1, COMMON block elements were aligned on 8-byte boundaries, but that violates the standard to do it as a default. 8.x aligns by default to 4-byte boundaries. If you want 8-byte, use -align dcommons.
0 Kudos
TimP
Honored Contributor III
519 Views
What standard would that violate? Not allowing COMMONs to have 16-byte alignment could easily break SSE code. Not to mention the very large performance penalty for mis-alignment of 64-bit data as well as vectorized data.
CVF used to give vociferous warnings if you forced double precision variables to be mis-aligned relative to start of COMMON, implying that COMMON was at least 8-byte aligned. Are we trying to break what worked with CVF?
0 Kudos
Steven_L_Intel1
Employee
519 Views
The ifort 8.x behavior matches CVF's. Note that I am talking about padding of individual components of the common, not the alignment of the start of the common itself. The padding can be up to 8 bytes with -align dcommons, and up to 4 bytes with -align commons, which is what you get with -align. Padding at more than the size of a default arithmetic unit breaks common sequence storage association as specified by the standard.
0 Kudos
Reply