This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stick addressable constants into the constant pool
- From: Dale Johannesen <dalej at apple dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Dale Johannesen <dalej at apple dot com>, fortran at gcc dot gnu dot org
- Date: Fri, 30 Jul 2004 16:51:00 -0700
- Subject: Re: stick addressable constants into the constant pool
- References: <20040730230653.GA27003@redhat.com>
On Jul 30, 2004, at 4:06 PM, Richard Henderson wrote:
This is a problem that Fortran faces more than most, because argument
passing is, by default, by reference. The difference in code
generation
can be seen in, e.g., intrinsic_scale.f90:
This did show up two testsuite bugs, which wrote to arguments that
were given as constants. Which now gives a SEGV, since Linux puts
the constant pool in read-only memory. I guess we'll have to see
how much trouble this give us with dusty decks...
Probably not much; other environments have done this for some time,
and changing constant arguments was never widely done in Fortran.
On the contrary, the Interesting behavior produced by changing the
value of, say, 2, usually makes an impression on novice Fortran
programmers, and they quickly learn not to do that.
I think most Fortran programmers would consider the SEGV in this
case an improvement. Diagnosing the error, which might be
possible with IMA, would be even better, of course.