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] Fix PR28268, ICE building vector const { 1, 1 }



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?

I agree, and there is indeed already get_one_constant in tree-ssa-math-opts.c.


I'd suggest that you move it to fold-const.c and use it.

I think -1 is way more "special" than 1. It is not stretching the argument as much as 1, because it is always "all ones".

Paolo


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