- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Given the following program, IFort refuses to compile it, and rightly so.
program xeq implicit none logical re,pe integer rf,pf equivalence (re, rf), (pe, pf) common/RPCOM/re,pe,rf,pf print *,loc(re),loc(rf) end
However, the error message does not clearly identify the problem, and seems to invite the user to try different alignment directives and compiler options.
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on IA-32, Version 17.0.1.143 Build 20161005 Copyright (C) 1985-2016 Intel Corporation. All rights reserved. xeq.f90(3): error #6501: The equivalences are causing alignment problems. [RE] logical re,pe -------------^ xeq.f90(3): error #6501: The equivalences are causing alignment problems. [PE] logical re,pe ----------------^ compilation aborted for xeq.f90 (code 1)
The real problem with the code is that re and rf occupy the same storage -- the first storage unit of the block; pe and pf do likewise -- the second storage of the block. In other words, the same storage unit appears more than once in the list of common block variables. Gfortran's error message is quite clear:
xeq.f90:7:24: common/RPCOM/re,pe,rf,pf 1 Error: Symbol 'rf' at (1) is already in a COMMON block
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting the issue. I have opened a bug report for it: DPD200416680.
Thanks,
Xiaoping Duan
Intel Customer Support
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page