This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reassociation
- To: tprince at cat dot e-mail dot com
- Subject: Re: Reassociation
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 17 Dec 1998 21:02:43 -0700
- cc: bosch at gnat dot com, burley at gnu dot org, egcs at cygnus dot com, hjstein at bfr dot co dot il, moshier at mediaone dot net, tim at wagner dot Princeton dot EDU
- Reply-To: law at cygnus dot com
In message <4.19981217.11.29.23.594944@cat.e-mail.com>you write:
> In view of the fact that left-to-right evaluation has been expected
> from C compilers and that most current Fortran compilers follow
> that scheme, I have tended to take that into account when setting
> up expressions where the compiler may apply Common
> Sub-expression Evaluation. I don't see that as anything more
> than a mild suggestion as to how the compiler should treat my
> code.
Yup. We often call this the principle of least suprise. It may be the case
that enough folks expect C to strictly evaluate these expressions left to right
and that changing it would cause massive problems, in which case we need to
think long and hard about how wise it is to "break" such code.
jeff