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]

Re: [PATCH] SHF_MERGE support for gcc


Jakub Jelinek wrote:

> The patch below is perhaps too aggressive, it merges e.g. even:
> const double d = 2.0;
> const double e = 2.0;
> into one memory location, is there something wrong about it from the
> standards point of view? 

Not from a Fortran point of view.  In the late seventies I used a
compiler (on a CDC-175 series computer) that allocated all numeric
constants that were equal to the same memory location.  Because this
type of computer didn't support read-only memory sections, it was
possible to make the following mistake (which, in accord with Murphy, I
indeed made):

      CALL SUB(A, 2.0)
      Z = (X + Y) / 2.0
      ....
      SUBROUTINE SUB(A, B)
      B = 1.0

and have the Z = line *not* give you the average of X and Y ;-)

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


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