]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/68799 (lto ICE on powerpc64le-linux-gnu builing...
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 18 Jan 2016 03:54:48 +0000 (03:54 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Mon, 18 Jan 2016 03:54:48 +0000 (03:54 +0000)
2016-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

Backport from mainline:
2016-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

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
gcc/gimple-ssa-strength-reduction.c

index a69e93799ddcbcb8647267f3e166a7671a869770..4d76bbc99435fa2c06e231ec30c27c120b374c68 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       Backport from mainline:
+       2016-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       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  <kyrylo.tkachov@arm.com>
 
        PR target/68648
index cb19399bd3f1315089fd2be237b1243a01064e21..fc48a1bc9cce52cead3342c2713be9078853db4a 100644 (file)
@@ -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++)
     {