diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-07-05 14:26:00 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-07-05 19:06:31 -0400 |
commit | 778099c426d7162000f1ed8d2937488e54021b75 (patch) | |
tree | 40a2233c4bf81082a22f53dbfed37be8d7d747e8 | |
parent | 988b07a66a96d70c47f697dd0d07c0e14c742451 (diff) | |
download | gcc-778099c426d7162000f1ed8d2937488e54021b75.zip gcc-778099c426d7162000f1ed8d2937488e54021b75.tar.gz gcc-778099c426d7162000f1ed8d2937488e54021b75.tar.bz2 |
Make compute_operand_range a tail call.
Tweak the routine so it is making a tail call.
* gimple-range-gori.cc (compute_operand_range): Convert to a tail
call.
-rw-r--r-- | gcc/gimple-range-gori.cc | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index b036ed5..6dc15a0 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -725,36 +725,34 @@ gori_compute::compute_operand_range (vrange &r, gimple *stmt, op1_trange, op1_frange, op2_trange, op2_frange); if (idx) tracer.trailer (idx, "compute_operand", res, name, r); + return res; } // Follow the appropriate operands now. - else if (op1_in_chain && op2_in_chain) - res = compute_operand1_and_operand2_range (r, handler, lhs, name, src, - vrel_ptr); - else if (op1_in_chain) + if (op1_in_chain && op2_in_chain) + return compute_operand1_and_operand2_range (r, handler, lhs, name, src, + vrel_ptr); + Value_Range vr; + gimple *src_stmt; + if (op1_in_chain) { - Value_Range vr (TREE_TYPE (op1)); + vr.set_type (TREE_TYPE (op1)); if (!compute_operand1_range (vr, handler, lhs, src, vrel_ptr)) return false; - gimple *src_stmt = SSA_NAME_DEF_STMT (op1); - gcc_checking_assert (src_stmt); - // Then feed this range back as the LHS of the defining statement. - return compute_operand_range (r, src_stmt, vr, name, src, vrel_ptr); + src_stmt = SSA_NAME_DEF_STMT (op1); } - else if (op2_in_chain) + else { - Value_Range vr (TREE_TYPE (op2)); + gcc_checking_assert (op2_in_chain); + vr.set_type (TREE_TYPE (op2)); if (!compute_operand2_range (vr, handler, lhs, src, vrel_ptr)) return false; - gimple *src_stmt = SSA_NAME_DEF_STMT (op2); - gcc_checking_assert (src_stmt); - // Then feed this range back as the LHS of the defining statement. - return compute_operand_range (r, src_stmt, vr, name, src, vrel_ptr); + src_stmt = SSA_NAME_DEF_STMT (op2); } - else - gcc_unreachable (); + gcc_checking_assert (src_stmt); + // Then feed this range back as the LHS of the defining statement. + return compute_operand_range (r, src_stmt, vr, name, src, vrel_ptr); // If neither operand is derived, this statement tells us nothing. - return res; } |