From 46fb44e8d514c55b91975c3166a7aed6197fc3b6 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Mon, 18 Jan 2016 03:54:48 +0000 Subject: [PATCH] backport: re PR tree-optimization/68799 (lto ICE on powerpc64le-linux-gnu builing python 2.7.x) 2016-01-17 Bill Schmidt Backport from mainline: 2016-01-17 Bill Schmidt PR tree-optimization/68799 * gimple-ssa-strength-reduction.c (create_phi_basis): Directly look up phi candidates in the statement-candidate map. (phi_add_costs): Likewise. (record_phi_increments): Likewise. (phi_incr_cost): Likewise. (ncd_with_phi): Likewise. (all_phi_incrs_profitable): Likewise. From-SVN: r232494 --- gcc/ChangeLog | 14 ++++++++++++++ gcc/gimple-ssa-strength-reduction.c | 18 ++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a69e93799ddc..4d76bbc99435 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2016-01-17 Bill Schmidt + + Backport from mainline: + 2016-01-17 Bill Schmidt + + PR tree-optimization/68799 + * gimple-ssa-strength-reduction.c (create_phi_basis): Directly + look up phi candidates in the statement-candidate map. + (phi_add_costs): Likewise. + (record_phi_increments): Likewise. + (phi_incr_cost): Likewise. + (ncd_with_phi): Likewise. + (all_phi_incrs_profitable): Likewise. + 2016-01-14 Kyrylo Tkachov PR target/68648 diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index cb19399bd3f1..fc48a1bc9cce 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -2251,7 +2251,8 @@ create_phi_basis (slsr_cand_t c, gimple from_phi, tree basis_name, slsr_cand_t basis = lookup_cand (c->basis); int nargs = gimple_phi_num_args (from_phi); basic_block phi_bb = gimple_bb (from_phi); - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (from_phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, from_phi)); phi_args.create (nargs); /* Process each argument of the existing phi that represents @@ -2362,7 +2363,8 @@ phi_add_costs (gimple phi, slsr_cand_t c, int one_add_cost) { unsigned i; int cost = 0; - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, phi)); /* If we work our way back to a phi that isn't dominated by the hidden basis, this isn't a candidate for replacement. Indicate this by @@ -2573,7 +2575,8 @@ static void record_phi_increments (slsr_cand_t basis, gimple phi) { unsigned i; - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, phi)); for (i = 0; i < gimple_phi_num_args (phi); i++) { @@ -2644,7 +2647,8 @@ phi_incr_cost (slsr_cand_t c, double_int incr, gimple phi, int *savings) unsigned i; int cost = 0; slsr_cand_t basis = lookup_cand (c->basis); - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, phi)); for (i = 0; i < gimple_phi_num_args (phi); i++) { @@ -2988,7 +2992,8 @@ ncd_with_phi (slsr_cand_t c, double_int incr, gimple phi, { unsigned i; slsr_cand_t basis = lookup_cand (c->basis); - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, phi)); for (i = 0; i < gimple_phi_num_args (phi); i++) { @@ -3196,7 +3201,8 @@ all_phi_incrs_profitable (slsr_cand_t c, gimple phi) { unsigned i; slsr_cand_t basis = lookup_cand (c->basis); - slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi)); + slsr_cand_t phi_cand = *((slsr_cand_t *) + pointer_map_contains (stmt_cand_map, phi)); for (i = 0; i < gimple_phi_num_args (phi); i++) { -- 2.47.2