This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [G95] [gfortran] Call fold
- From: Paul Brook <paul at nowt dot org>
- To: Feng Wang <wf_cs at yahoo dot com>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>,gcc-g95 List <gcc-g95-devel at lists dot sourceforge dot net>
- Date: Sat, 13 Sep 2003 10:38:36 +0100
- Subject: Re: [G95] [gfortran] Call fold
- References: <20030913080301.41029.qmail@web15305.mail.bjs.yahoo.com>
On Saturday 13 September 2003 9:03 am, Feng Wang wrote:
> Hi, Paul
> I think the fold added is useless. When all the operants are constant,
> the fold is useful. It will merge the trees into one. When one of the
> operants is not constant, I can not see the affection, at least from file
> generated by -fdump-tree-original.
i = sign (1, n)
Before:
i = 1 >= 0 ^ n >= 0 ? -1 : 1;
After:
i = n < 0 ? -1 : 1;
If fold could also determine that n was positive, then the whole thing would
be folded into a single constant.
Paul