+2019-03-18 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/88945
+ * tree-ssanames.c (release_ssa_name_fn): For released SSA names
+ use a TREE_TYPE of error_mark_node to avoid ICEs when dumping
+ basic-blocks that are removed. Remove restoring SSA_NAME_VAR.
+ * tree-outof-ssa.c (eliminate_useless_phis): Remove redundant checking.
+
2019-03-18 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-run.c (struct output): Make next_output unsigned.
gphi *phi = gsi.phi ();
result = gimple_phi_result (phi);
if (virtual_operand_p (result))
- {
- /* There should be no arguments which are not virtual, or the
- results will be incorrect. */
- if (flag_checking)
- for (size_t i = 0; i < gimple_phi_num_args (phi); i++)
- {
- tree arg = PHI_ARG_DEF (phi, i);
- if (TREE_CODE (arg) == SSA_NAME
- && !virtual_operand_p (arg))
- {
- fprintf (stderr, "Argument of PHI is not virtual (");
- print_generic_expr (stderr, arg, TDF_SLIM);
- fprintf (stderr, "), but the result is :");
- print_gimple_stmt (stderr, phi, 0, TDF_SLIM);
- internal_error ("SSA corruption");
- }
- }
-
- remove_phi_node (&gsi, true);
- }
+ remove_phi_node (&gsi, true);
else
{
/* Also remove real PHIs with no uses. */
defining statement. */
if (! SSA_NAME_IN_FREE_LIST (var))
{
- tree saved_ssa_name_var = SSA_NAME_VAR (var);
int saved_ssa_name_version = SSA_NAME_VERSION (var);
use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));
/* Restore the version number. */
SSA_NAME_VERSION (var) = saved_ssa_name_version;
- /* Hopefully this can go away once we have the new incremental
- SSA updating code installed. */
- SET_SSA_NAME_VAR_OR_IDENTIFIER (var, saved_ssa_name_var);
-
/* Note this SSA_NAME is now in the first list. */
SSA_NAME_IN_FREE_LIST (var) = 1;
+ /* Put in a non-NULL TREE_TYPE so dumping code will not ICE
+ if it happens to come along a released SSA name and tries
+ to inspect its type. */
+ TREE_TYPE (var) = error_mark_node;
+
/* And finally queue it so that it will be put on the free list. */
vec_safe_push (FREE_SSANAMES_QUEUE (fn), var);
}