This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR28268, ICE building vector const { 1, 1 }
On Thu, 6 Jul 2006, Ian Lance Taylor wrote:
> Richard Guenther <rguenther@suse.de> writes:
>
> > > This makes me uncomfortable. The number zero seems like a special
> > > case which merits special handling. The number one does not. What
> > > you are looking for is a function which returns the multiplicative
> > > identity for TYPE. Currently you are getting it by calling
> > > fold_convert (TYPE, integer_one_node). Suppose you write the
> > > multiplicative identify function, and handle VECTOR_TYPE there, rather
> > > than making the number one a special case in fold_convert?
> > >
> > > Otherwise I think you need to give some justification for why
> > > fold_convert should not permit any constant for VECTOR_TYPE. And it's
> > > hard to see what that justification should be.
> >
> > My reasoning was that as zero (identity for addition), one is a special
> > number (identity for multiplication). There's one other special number
> > that one could add, -1, which represents a "sign", but that stretches
> > the argument a bit.
>
> The number zero is special for several reasons. In particular, we
> probably use it when clearing memory.
The idiom of fold_convert (type, integer_zero_node) isn't used too often
(at least if appearing on one line).
>
> The number one does not seem to me to have the same properties.
>
> > The other fix I was thinking about is simply punting on VECTOR_TYPE
> > arguments completely for the optimizations in fold_plusminus_mult_expr.
>
> Sure, that is the easy way.
So, what do you want me to do?
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs