[Bug fortran/49993] arrays declared as parameter are not allocated in read-only memory
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 4 11:00:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49993
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |burnus at gcc dot gnu.org
Resolution| |FIXED
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-04 10:59:35 UTC ---
(In reply to comment #0)
> Could gfortran be modified to allocate arrays declared in parameter in the
> rodata section? This would help detecting bugs and may even provide a slight
> performance and code size advantage.
A belated thanks for the bugreport!
(In reply to comment #4)
> This has probably been fixed by revision 180878 (PR fortran/50960).
Looks like. I get the wished-for segfault for the second program of comment 0.
The assembler also looks OK, but I have to admit that I am not really an
assembler person.
For the simpler
module m
integer, parameter :: xxx(*) = [1,2,3,4]
end module m
one gets now the following:
.globl __m_MOD_xxx
.section .rodata
.align 16
.type __m_MOD_xxx, @object
.size __m_MOD_xxx, 16
__m_MOD_xxx:
.long 1
.long 2
.long 3
.long 4
Hence, I indeed see the .rodata for the correct variable.
I close this bug now - please reopen if something is still wrong.
More information about the Gcc-bugs
mailing list