+2016-05-19 Martin Liska <mliska@suse.cz>
+
+ * ipa-pure-const.c (set_function_state): Remove an existing
+ funct_state.
+ (remove_node_data): Do not free it as it's released
+ in set_function_state.
+
2016-05-19 Martin Liska <mliska@suse.cz>
* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Release
if (!funct_state_vec.exists ()
|| funct_state_vec.length () <= (unsigned int)node->uid)
funct_state_vec.safe_grow_cleared (node->uid + 1);
+
+ /* If funct_state_vec already contains a funct_state, we have to release
+ it before it's going to be ovewritten. */
+ if (funct_state_vec[node->uid] != NULL
+ && funct_state_vec[node->uid] != &varying_state)
+ free (funct_state_vec[node->uid]);
+
funct_state_vec[node->uid] = s;
}
remove_node_data (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
{
if (has_function_state (node))
- {
- funct_state l = get_function_state (node);
- if (l != &varying_state)
- free (l);
- set_function_state (node, NULL);
- }
+ set_function_state (node, NULL);
}
\f