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: [tree-ssa] [PATCH] fix PR 13066, fold being stupid


On Sat, 2004-02-28 at 21:09, Andrew Pinski wrote:

> I prefer the not folding patch as it is a memory savings one unless 
> someone can prove me wrong.
> 
Funny.  I was just toying around with this on Friday.  I had initially
done the folding version and was going to submit it for review.

I tested your non-folding patch and the problem I see is that it doesn't
stop us from generating "bad" GIMPLE code:

int f()
{
   ...
   int T.1;
   ...
   T.1 = a.0 == 0;
   ...
   if (T.1 != iftmp.2)
   ...
}

T.1 ought to be of type 'bool', shouldn't it?

I agree that with the call to fold_convert we generate more GIMPLE code
initially, but it looks more correct to me:

int f()
{
  bool iftmp.0;
  bool T.6;
  bool T.7;
  ...
  if (a.1 == 0)
    iftmp.0 = 1;	<= Nit. pretty printer ought to render 'true';
  else
    iftmp.0 = 0;
  ...
  T.6 = (bool)iftmp.2;
  T.7 = iftmp.0 ^ T.6;
  if (T.7)
  ...
}

So, I would go with the call to fold_convert, but I'll let our FE folks
decide.


Diego.


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