This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49993] arrays declared as parameter are not allocated in read-only memory
- From: "arnaud02 at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 8 Aug 2011 10:28:31 +0000
- Subject: [Bug fortran/49993] arrays declared as parameter are not allocated in read-only memory
- Auto-submitted: auto-generated
- References: <bug-49993-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49993
--- Comment #1 from Arnaud Desitter <arnaud02 at users dot sourceforge.net> 2011-08-08 10:28:27 UTC ---
The equivalent "C" program results in the expected "segmentation fault".
void a1(int *ia) {
*ia = 1;
}
void a2(void) {
static const int ia[] = { 2 };
a1(ia);
}
int main(void) {
a2();
return 0;
}