This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: associative law in combine
- To: Joern Rennecke <amylaar at redhat dot com>
- Subject: Re: associative law in combine
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 18 Jul 2001 10:02:07 +0200
- CC: Jan Hubicka <jh at suse dot cz>, gcc at gcc dot gnu dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200107172259.f6HMxYU31134@phal.cambridge.redhat.com>
Joern Rennecke wrote:
> > > Jan Hubicka wrote:
> > OK, so to speak loud - where is the proper place to convert
> > a/b/c to a/(b*c) at tree level. fold-const or some other?
>
> Only if b and c are constants, the operations are floating point, and
> b can be multiplied with c without loss of precision or overflow.
> Or if b and/or c is a power of two, and b can be multiplied with c without
> overflow.
Joern is right, Jan. One can argue about the loss of precision (under
unsafe math optimisations), but not the overflow. I overlooked that
issue in my reply to you. Because overflow can only be determined at
compile time with constants, this conversion cannot be right for
variables.
--
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)