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: [patch] convert.c: Fix PR tree-optimization/17512.


On Wed, Sep 22, 2004 at 10:23:01AM -0400, Diego Novillo wrote:
> > > > The patch simply removes a piece of code in convert_to_integer()
> > > > that
> > > > creates TRUTH_*_EXPR of whatever integer types that the caller
> > > > requests.
> > > > 
> > > Why not tell invert_truthvalue() to accept INTEGRAL_TYPE_P instead of
> > > just boolean?  I can't think of a reason why we shouldn't accept any
> > > integral values for TRUTH_*_EXPR (nonzero is true, zero is false).
> > 
> > What is the point of having boolean types at all, then?
> > 
> Hmm, OK.  How about we handle SSA_NAMEs and _DECLs in invert_truthvalue
> then?  Given an SSA_NAME N, return N != 0.  I'm trying to avoid not
> applying the transformation.

The question becomes, if we wanted a boolean value, why hadn't
we generated N != 0 in the first place?

I'm thinking that Kazu's patch at the start of the thread is fine,
and that if we're missing an optimization, that's something to be
fixed elsewhere.


r~


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