[PATCH] Fix PR25500, pessimization on SSE code caused by count_type_elements (expr.c)

Mark Mitchell mark@codesourcery.com
Thu Aug 17 00:26:00 GMT 2006


Paolo Bonzini wrote:

> 2006-08-07  Paolo Bonzini  <bonzini@gnu.org>
> 
> 	PR tree-optimization/25500
> 	* expr.c (count_type_elements): Treat non-BLKmode vectors as a
> 	single element.
> 
> Index: expr.c
> ===================================================================
> --- expr.c      (revision 115990)
> +++ expr.c      (working copy)
> @@ -4763,7 +4763,7 @@ count_type_elements (tree type, bool all
>        return 2;
> 
>      case VECTOR_TYPE:
> -      return TYPE_VECTOR_SUBPARTS (type);
> +      return TYPE_MODE (type) == BLKmode ? TYPE_VECTOR_SUBPARTS (type) : 1;
> 
>      case INTEGER_TYPE:
>      case REAL_TYPE:

While I applaud the results of this patch, this doesn't really make
sense to me.  A vector has as many elements as it has, whether or not it
fits in a machine register.  That's a philosophical concern, but more
practically, won't gimplify_init_constructor break?

Is it possible to instead teach the SRA code to handle this case specially?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list