This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45305] New: Array-valued calles to elementals are not simplified
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2010 10:19:02 -0000
- Subject: [Bug fortran/45305] New: Array-valued calles to elementals are not simplified
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Found when looking at PR fortran/36158
If the argument is an initialization expression and not too large, it should be
expanded. While the following works:
real, parameteR :: bes(2) = bessel_jn([1,2], 1.0)
print *, bes
end
The "if" is never optimized away for:
if (any (abs(bessel_jn([1,2], 1.0) - bessel_jn([1,2], 1.0)) &
> epsilon(0.0))) &
call I_do_not_exist()
if (any (abs(bessel_jn(1, 2, 1.0) - bessel_jn([1,2], 1.0)) &
> epsilon(0.0))) &
call I_do_not_exist()
end
such that one gets linkage errors:
test.f90:(.text+0x8e): undefined reference to `i_do_not_exist_'
test.f90:(.text+0x108): undefined reference to `i_do_not_exist_'
--
Summary: Array-valued calles to elementals are not simplified
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45305