This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [G95] [gfortran] Call fold


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]