This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stick addressable constants into the constant pool


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]