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 memory leak in vectorizable_conversion (PR middle-end/56461)


On Fri, 1 Mar 2013, Jakub Jelinek wrote:

> Hi!
> 
> For the modifier == NONE && !slp_node case we call vect_get_vec_defs, so
> we overwrite vec_oprnds0, thus we shouldn't allocate it.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Thanks,
Richard.

> 2013-03-01  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR middle-end/56461
> 	* tree-vect-stmts.c (vectorizable_conversion): Don't call
> 	vec_oprnds0.create (1) for modifier == NONE.
> 
> --- gcc/tree-vect-stmts.c.jj	2013-03-01 11:59:03.000000000 +0100
> +++ gcc/tree-vect-stmts.c	2013-03-01 12:39:08.521188115 +0100
> @@ -2616,15 +2616,13 @@ vectorizable_conversion (gimple stmt, gi
>  
>    if (!slp_node)
>      {
> -      if (modifier == NONE)
> -	vec_oprnds0.create (1);
> -      else if (modifier == WIDEN)
> +      if (modifier == WIDEN)
>  	{
>  	  vec_oprnds0.create (multi_step_cvt ? vect_pow2(multi_step_cvt) : 1);
>  	  if (op_type == binary_op)
>  	    vec_oprnds1.create (1);
>  	}
> -      else
> +      else if (modifier == NARROW)
>  	vec_oprnds0.create (
>  		   2 * (multi_step_cvt ? vect_pow2 (multi_step_cvt) : 1));
>      }
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend


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