This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] SHF_MERGE support for gcc
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] SHF_MERGE support for gcc
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Fri, 20 Apr 2001 22:04:20 +0200
- CC: gcc-patches at gcc dot gnu dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <20010420174841.B852@sunsite.ms.mff.cuni.cz>
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)