This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ccp (PR tree-optimization/56396)
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