stick addressable constants into the constant pool
Dale Johannesen
dalej@apple.com
Fri Jul 30 23:51:00 GMT 2004
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.
More information about the Fortran
mailing list