From: Richard Biener Date: Mon, 18 Mar 2019 13:59:11 +0000 (+0000) Subject: re PR tree-optimization/88945 (ICE in fold_convert_loc in FRE when using -fdump-tree... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca6d4a08c120841654acb10b973b0d009b053ef3;p=gcc.git re PR tree-optimization/88945 (ICE in fold_convert_loc in FRE when using -fdump-tree-fre-details) 2019-03-18 Richard Biener 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. From-SVN: r269765 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4688296cb8a..a8d41e41303 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-03-18 Richard Biener + + 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 * config/gcn/gcn-run.c (struct output): Make next_output unsigned. diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index c75d72737a6..6cac55bde06 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -809,26 +809,7 @@ eliminate_useless_phis (void) 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. */ diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index c457334bb31..5bac799e9a3 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -595,7 +595,6 @@ release_ssa_name_fn (struct function *fn, tree var) 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)); @@ -621,13 +620,14 @@ release_ssa_name_fn (struct function *fn, tree 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); }