[Bug fortran/50981] New: [4.4/4.5/4.6/4.7 Regression] Wrong-code for scalarizing ELEMENTAL call with absent OPTIONAL argument
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 3 14:19:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50981
Bug #: 50981
Summary: [4.4/4.5/4.6/4.7 Regression] Wrong-code for
scalarizing ELEMENTAL call with absent OPTIONAL
argument
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Created attachment 25705
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25705
test case
As reported by Andriy Kostyuk,
http://gcc.gnu.org/ml/fortran/2011-11/msg00035.html
There is a wrong-code issue with absent OPTIONAL arguments and ELEMENTAL.
It works for me with 4.1, 4.3, and
4.4.0 20090206 (experimental) [trunk revision 143983] (SUSE Linux)
It fails for me with 4.5, 4.6 and 4.7
4.4.6 20110219 (prerelease) [gcc-4_4-branch revision 170290]
and was reported to be broken in
GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
If one looks at the dump, one finds:
ff (real(kind=8) & restrict a, integer(kind=4) * b)
{
...
integer(kind=4) D.1747;
D.1747 = *b;
...
while (1)
{
if (S.1 > 2) goto L.2;
val.0 = gg (&ac[S.1 + -1], &D.1747) + val.0;
S.1 = S.1 + 1;
}
The "D.1747 = *b;" is a rather bad idea if "b == NULL".
More information about the Gcc-bugs
mailing list