[G95] [gfortran] Call fold

Paul Brook paul@nowt.org
Sat Sep 13 09:38:00 GMT 2003


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



More information about the Gcc-patches mailing list