[PATCH] Fix ccp (PR tree-optimization/56396)

Jakub Jelinek jakub@redhat.com
Wed Feb 20 09:57:00 GMT 2013


On Wed, Feb 20, 2013 at 10:52:52AM +0100, Richard Biener wrote:
> *************** get_value (tree var)
> *** 295,301 ****
>   {
>     prop_value_t *val;
>   
> !   if (const_val == NULL)
>       return NULL;
>   
>     val = &const_val[SSA_NAME_VERSION (var)];
> --- 296,303 ----
>   {
>     prop_value_t *val;
>   
> !   if (const_val == NULL
> !       || SSA_NAME_VERSION (var) >= n_const_val)
>       return NULL;

You could just use
  if (SSA_NAME_VERSION (var) >= n_const_val)

test here if upon free (const_val); you'd set n_const_val back to 0.

	Jakub



More information about the Gcc-patches mailing list