Bug 1622238
Summary: | GFortran mis-handles EQUIVALENCES in multiple ways | ||
---|---|---|---|
Product: | Red Hat Developer Toolset | Reporter: | Jeff Law <law> |
Component: | gcc | Assignee: | Marek Polacek <mpolacek> |
Status: | CLOSED ERRATA | QA Contact: | Michael Petlan <mpetlan> |
Severity: | unspecified | Docs Contact: | Vladimír Slávik <vslavik> |
Priority: | unspecified | ||
Version: | DTS 7.1 RHEL 7 | CC: | bgollahe, jakub, kanderso, law, mcermak, mnewsome, mpetlan, mpolacek, ohudlick |
Target Milestone: | alpha | ||
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | devtoolset-7-gcc-7.3.1-5.13.el7 | Doc Type: | Bug Fix |
Doc Text: |
Previously, the GNU Fortran Compiler did not handle "EQUIVALENCE" statements that involved variables with the "AUTOMATIC" attribute. Support for handling these legacy constructs has been added, and they are now processed correctly.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2018-08-30 17:24:06 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jeff Law
2018-08-24 20:45:16 UTC
Is it the following? $ scl enable devtoolset-7 -- gfortran -frecursive -fno-automatic -fdec-static -o test test.f90 f951: Warning: Flag ‘-fno-automatic’ overwrites ‘-frecursive’ test.f90:17:22: equivalence (countcopy, something) 1 Error: EQUIVALENCE attribute conflicts with AUTOMATIC attribute in ‘countcopy’ at (1) $ rpmquery devtoolset-7-gcc-gfortran devtoolset-7-gcc-gfortran-7.3.1-5.10.el7.x86_64 I see e.g. in fortran-08-007r2.pdf in 5.7.1.1: "An equivalence-object shall not be a designator with a base object that is a dummy argument, a pointer, an allocatable variable, a derived-type object that has an allocatable ultimate component, an object of a nonsequence derived type, an object of a derived type that has a pointer at any level of component selection, an automatic object, a function name, an entry name, a result name, a variable with the BIND attribute, a variable in a common block that has the BIND attribute, or a named constant." Are the automatic variables not automatic objects in Fortran terms? Mpetlan -- you have to use one or more of the legacy fortran options. I don't recall which one offhand. Jakub -- Certainly allowed in legacy codes. I even found it explicitly allowed in various docs when I was doing research. Ultimately Bloomberg needs it, so we have to do something here. We already tried "don't do that" with them. They were actually receptive to that until they dug deeper into their code and realized how much would have to change. After further reading, it seems automatic object as Fortran term is roughly variable length types, something where array bounds or other type parameters aren't initialization expressions (approx. constant expressions). Then there is the DEC -fdec-static AUTOMATIC extension, I guess if the DEC derived implementations don't complain about conflicts between that attribute and equivalence, it might be ok. I think the options should be -std=extra-legacy -fdec-static -frecursive -fno-automatic VERIFIED for devtoolset-7-gcc-7.3.1-5.13.el{6,7}. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:2604 |