summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-10 09:20:29 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-10 09:20:29 +0000
commit03d37e4ed640ac104b8c982da5e9bd6fb1c3e6b9 (patch)
tree538c53782d228ed64003ea7683f91c231d7ad532 /gcc/tree-ssa-math-opts.c
parente0de85135eb2a5dcf4a3f414e4de73cea208dd68 (diff)
downloadgcc-03d37e4ed640ac104b8c982da5e9bd6fb1c3e6b9.tar.gz
2012-08-10 Richard Guenther <rguenther@suse.de>
* tree-ssa-pre.c (pretemp, storetemp, prephitemp): Remove. (need_creation): Remove. (get_representative_for): Use anonymous named SSA names. (create_expression_by_pieces): Likewise. (insert_into_preds_of_block): Likewise. (init_pre): Do not init removed vars. (fini_pre): Do not free need_creation. * tree-ssa-forwprop.c (simplify_bitwise_binary): Use anonymous SSA names. * tree-ssa-loop-manip.c (create_iv): Likewise. * value-prof.c (gimple_divmod_fixed_value): Likewise. (gimple_mod_pow2): Likewise. (gimple_mod_subtract): Likewise. (gimple_ic): Likewise. (gimple_stringop_fixed_value): Likewise. * tree-ssa-phiopt.c (condstoretemp): Remove. (tree_ssa_phiopt_worker): Use anonymous named SSA names. (conditional_replacement): Likewise. (abs_replacement): Likewise. (cond_store_replacement): Likewise. (cond_if_else_store_replacement_1): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. (rewrite_bittest): Likewise. * tree-ssa-reassoc.c (build_and_add_sum): Get type from callers and build anonymous SSA names. (undistribute_ops_list): Adjust. (eliminate_redundant_comparison): Use anonymous SSA names. (rewrite_expr_tree_parallel): Likewise. (get_reassoc_pow_ssa_name): Remove. (attempt_builtin_powi): Adjust. (reassociate_bb): Likewise. * tree-ssa-strlen.c (get_string_length): Use anonymous SSA names. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. (build_arrays): Likewise. * tree-tailcall.c (adjust_return_value_with_ops): Likewise. (create_tailcall_accumulator): Likewise. * tree-vect-generic.c (expand_vector_divmod): Likewise. * tree-profile.c (gcov_type_tmp_var): Remove. (gimple_init_edge_profiler): Do not initialize it and use anonymous SSA names. (gimple_gen_ic_profiler): Likewise. (tree_profiling): Adjust. * tree-sra.c (build_ref_for_offset): Use anonymous SSA names. * tree-ssa-math-opts.c (execute_cse_sincos_1): Likewise. (powi_as_mults_1): Likewise. (powi_as_mults): Likewise. (build_and_insert_call): Adjust. (build_and_insert_binop): Likewise. (build_and_insert_ref): Likewise. (build_and_insert_cast): Likewise. (gimple_expand_builtin_pow): Likewise. (gimple_expand_builtin_cabs): Likewise. (execute_optimize_bswap): Use anonymous SSA names. (convert_mult_to_widen): Likewise. (convert_plusminus_to_widen): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-if-conv.c (ifc_temp_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-parloops.c (take_address_of): Likewise. * tree-vect-data-refs.c (vect_permute_store_chain): Likewise. (vect_permute_load_chain): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * tree-vect-patterns.c (vect_recog_temp_ssa_var): Likewise. (vect_handle_widen_op_by_const): Likewise. (vect_operation_fits_smaller_type): Likewise. (vect_recog_over_widening_pattern): Likewise. * tree-vect-stmts.c (vect_init_vector): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges): Likewise. (simplify_float_conversion_using_ranges): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c171
1 files changed, 74 insertions, 97 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 2a37abe0f13..2eed792da01 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -740,9 +740,8 @@ execute_cse_sincos_1 (tree name)
fndecl = mathfn_built_in (type, BUILT_IN_CEXPI);
if (!fndecl)
return false;
- res = create_tmp_reg (TREE_TYPE (TREE_TYPE (fndecl)), "sincostmp");
stmt = gimple_build_call (fndecl, 1, name);
- res = make_ssa_name (res, stmt);
+ res = make_temp_ssa_name (TREE_TYPE (TREE_TYPE (fndecl)), stmt, "sincostmp");
gimple_call_set_lhs (stmt, res);
def_stmt = SSA_NAME_DEF_STMT (name);
@@ -758,7 +757,6 @@ execute_cse_sincos_1 (tree name)
gsi = gsi_after_labels (top_bb);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
}
- update_stmt (stmt);
sincos_stats.inserted++;
/* And adjust the recorded old call sites. */
@@ -939,7 +937,7 @@ powi_cost (HOST_WIDE_INT n)
static tree
powi_as_mults_1 (gimple_stmt_iterator *gsi, location_t loc, tree type,
- HOST_WIDE_INT n, tree *cache, tree target)
+ HOST_WIDE_INT n, tree *cache)
{
tree op0, op1, ssa_target;
unsigned HOST_WIDE_INT digit;
@@ -948,23 +946,23 @@ powi_as_mults_1 (gimple_stmt_iterator *gsi, location_t loc, tree type,
if (n < POWI_TABLE_SIZE && cache[n])
return cache[n];
- ssa_target = make_ssa_name (target, NULL);
+ ssa_target = make_temp_ssa_name (type, NULL, "powmult");
if (n < POWI_TABLE_SIZE)
{
cache[n] = ssa_target;
- op0 = powi_as_mults_1 (gsi, loc, type, n - powi_table[n], cache, target);
- op1 = powi_as_mults_1 (gsi, loc, type, powi_table[n], cache, target);
+ op0 = powi_as_mults_1 (gsi, loc, type, n - powi_table[n], cache);
+ op1 = powi_as_mults_1 (gsi, loc, type, powi_table[n], cache);
}
else if (n & 1)
{
digit = n & ((1 << POWI_WINDOW_SIZE) - 1);
- op0 = powi_as_mults_1 (gsi, loc, type, n - digit, cache, target);
- op1 = powi_as_mults_1 (gsi, loc, type, digit, cache, target);
+ op0 = powi_as_mults_1 (gsi, loc, type, n - digit, cache);
+ op1 = powi_as_mults_1 (gsi, loc, type, digit, cache);
}
else
{
- op0 = powi_as_mults_1 (gsi, loc, type, n >> 1, cache, target);
+ op0 = powi_as_mults_1 (gsi, loc, type, n >> 1, cache);
op1 = op0;
}
@@ -982,8 +980,9 @@ static tree
powi_as_mults (gimple_stmt_iterator *gsi, location_t loc,
tree arg0, HOST_WIDE_INT n)
{
- tree cache[POWI_TABLE_SIZE], result, type = TREE_TYPE (arg0), target;
+ tree cache[POWI_TABLE_SIZE], result, type = TREE_TYPE (arg0);
gimple div_stmt;
+ tree target;
if (n == 0)
return build_real (type, dconst1);
@@ -991,14 +990,12 @@ powi_as_mults (gimple_stmt_iterator *gsi, location_t loc,
memset (cache, 0, sizeof (cache));
cache[1] = arg0;
- target = create_tmp_reg (type, "powmult");
- result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache, target);
-
+ result = powi_as_mults_1 (gsi, loc, type, (n < 0) ? -n : n, cache);
if (n >= 0)
return result;
/* If the original exponent was negative, reciprocate the result. */
- target = make_ssa_name (target, NULL);
+ target = make_temp_ssa_name (type, NULL, "powmult");
div_stmt = gimple_build_assign_with_ops (RDIV_EXPR, target,
build_real (type, dconst1),
result);
@@ -1029,23 +1026,19 @@ gimple_expand_builtin_powi (gimple_stmt_iterator *gsi, location_t loc,
}
/* Build a gimple call statement that calls FN with argument ARG.
- Set the lhs of the call statement to a fresh SSA name for
- variable VAR. If VAR is NULL, first allocate it. Insert the
+ Set the lhs of the call statement to a fresh SSA name. Insert the
statement prior to GSI's current position, and return the fresh
SSA name. */
static tree
build_and_insert_call (gimple_stmt_iterator *gsi, location_t loc,
- tree *var, tree fn, tree arg)
+ tree fn, tree arg)
{
gimple call_stmt;
tree ssa_target;
- if (!*var)
- *var = create_tmp_reg (TREE_TYPE (arg), "powroot");
-
call_stmt = gimple_build_call (fn, 1, arg);
- ssa_target = make_ssa_name (*var, NULL);
+ ssa_target = make_temp_ssa_name (TREE_TYPE (arg), NULL, "powroot");
gimple_set_lhs (call_stmt, ssa_target);
gimple_set_location (call_stmt, loc);
gsi_insert_before (gsi, call_stmt, GSI_SAME_STMT);
@@ -1060,9 +1053,10 @@ build_and_insert_call (gimple_stmt_iterator *gsi, location_t loc,
static tree
build_and_insert_binop (gimple_stmt_iterator *gsi, location_t loc,
- tree target, enum tree_code code, tree arg0, tree arg1)
+ const char *name, enum tree_code code,
+ tree arg0, tree arg1)
{
- tree result = make_ssa_name (target, NULL);
+ tree result = make_temp_ssa_name (TREE_TYPE (arg0), NULL, name);
gimple stmt = gimple_build_assign_with_ops (code, result, arg0, arg1);
gimple_set_location (stmt, loc);
gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
@@ -1070,29 +1064,33 @@ build_and_insert_binop (gimple_stmt_iterator *gsi, location_t loc,
}
/* Build a gimple reference operation with the given CODE and argument
- ARG, assigning the result to a new SSA name for variable TARGET.
+ ARG, assigning the result to a new SSA name of TYPE with NAME.
Insert the statement prior to GSI's current position, and return
the fresh SSA name. */
static inline tree
build_and_insert_ref (gimple_stmt_iterator *gsi, location_t loc, tree type,
- tree target, enum tree_code code, tree arg0)
+ const char *name, enum tree_code code, tree arg0)
{
- tree result = make_ssa_name (target, NULL);
+ tree result = make_temp_ssa_name (type, NULL, name);
gimple stmt = gimple_build_assign (result, build1 (code, type, arg0));
gimple_set_location (stmt, loc);
gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
return result;
}
-/* Build a gimple assignment to cast VAL to TARGET. Insert the statement
+/* Build a gimple assignment to cast VAL to TYPE. Insert the statement
prior to GSI's current position, and return the fresh SSA name. */
static tree
build_and_insert_cast (gimple_stmt_iterator *gsi, location_t loc,
- tree target, tree val)
+ tree type, tree val)
{
- return build_and_insert_binop (gsi, loc, target, CONVERT_EXPR, val, NULL);
+ tree result = make_ssa_name (type, NULL);
+ gimple stmt = gimple_build_assign_with_ops (NOP_EXPR, result, val, NULL_TREE);
+ gimple_set_location (stmt, loc);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ return result;
}
/* ARG0 and ARG1 are the two arguments to a pow builtin call in GSI
@@ -1108,7 +1106,6 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
REAL_VALUE_TYPE c2, dconst3;
HOST_WIDE_INT n;
tree type, sqrtfn, cbrtfn, sqrt_arg0, sqrt_sqrt, result, cbrt_x, powi_cbrt_x;
- tree target = NULL_TREE;
enum machine_mode mode;
bool hw_sqrt_exists;
@@ -1141,7 +1138,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
if (sqrtfn
&& REAL_VALUES_EQUAL (c, dconsthalf)
&& !HONOR_SIGNED_ZEROS (mode))
- return build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
+ return build_and_insert_call (gsi, loc, sqrtfn, arg0);
/* Optimize pow(x,0.25) = sqrt(sqrt(x)). Assume on most machines that
a builtin sqrt instruction is smaller than a call to pow with 0.25,
@@ -1157,10 +1154,10 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
&& hw_sqrt_exists)
{
/* sqrt(x) */
- sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
+ sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
/* sqrt(sqrt(x)) */
- return build_and_insert_call (gsi, loc, &target, sqrtfn, sqrt_arg0);
+ return build_and_insert_call (gsi, loc, sqrtfn, sqrt_arg0);
}
/* Optimize pow(x,0.75) = sqrt(x) * sqrt(sqrt(x)) unless we are
@@ -1176,13 +1173,13 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
&& hw_sqrt_exists)
{
/* sqrt(x) */
- sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
+ sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
/* sqrt(sqrt(x)) */
- sqrt_sqrt = build_and_insert_call (gsi, loc, &target, sqrtfn, sqrt_arg0);
+ sqrt_sqrt = build_and_insert_call (gsi, loc, sqrtfn, sqrt_arg0);
/* sqrt(x) * sqrt(sqrt(x)) */
- return build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ return build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
sqrt_arg0, sqrt_sqrt);
}
@@ -1199,7 +1196,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
&& cbrtfn
&& (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode))
&& REAL_VALUES_EQUAL (c, dconst1_3))
- return build_and_insert_call (gsi, loc, &target, cbrtfn, arg0);
+ return build_and_insert_call (gsi, loc, cbrtfn, arg0);
/* Optimize pow(x,1./6.) = cbrt(sqrt(x)). Don't do this optimization
if we don't have a hardware sqrt insn. */
@@ -1215,10 +1212,10 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
&& REAL_VALUES_EQUAL (c, dconst1_6))
{
/* sqrt(x) */
- sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
+ sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
/* cbrt(sqrt(x)) */
- return build_and_insert_call (gsi, loc, &target, cbrtfn, sqrt_arg0);
+ return build_and_insert_call (gsi, loc, cbrtfn, sqrt_arg0);
}
/* Optimize pow(x,c), where n = 2c for some nonzero integer n, into
@@ -1250,17 +1247,17 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
/* Calculate sqrt(x). When n is not 1 or -1, multiply it by the
result of the optimal multiply sequence just calculated. */
- sqrt_arg0 = build_and_insert_call (gsi, loc, &target, sqrtfn, arg0);
+ sqrt_arg0 = build_and_insert_call (gsi, loc, sqrtfn, arg0);
if (absu_hwi (n) == 1)
result = sqrt_arg0;
else
- result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ result = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
sqrt_arg0, powi_x_ndiv2);
/* If n is negative, reciprocate the result. */
if (n < 0)
- result = build_and_insert_binop (gsi, loc, target, RDIV_EXPR,
+ result = build_and_insert_binop (gsi, loc, "powroot", RDIV_EXPR,
build_real (type, dconst1), result);
return result;
}
@@ -1305,24 +1302,24 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
/* Calculate powi(cbrt(x), n%3). Don't use gimple_expand_builtin_powi
as that creates an unnecessary variable. Instead, just produce
either cbrt(x) or cbrt(x) * cbrt(x). */
- cbrt_x = build_and_insert_call (gsi, loc, &target, cbrtfn, arg0);
+ cbrt_x = build_and_insert_call (gsi, loc, cbrtfn, arg0);
if (absu_hwi (n) % 3 == 1)
powi_cbrt_x = cbrt_x;
else
- powi_cbrt_x = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ powi_cbrt_x = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
cbrt_x, cbrt_x);
/* Multiply the two subexpressions, unless powi(x,abs(n)/3) = 1. */
if (absu_hwi (n) < 3)
result = powi_cbrt_x;
else
- result = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ result = build_and_insert_binop (gsi, loc, "powroot", MULT_EXPR,
powi_x_ndiv3, powi_cbrt_x);
/* If n is negative, reciprocate the result. */
if (n < 0)
- result = build_and_insert_binop (gsi, loc, target, RDIV_EXPR,
+ result = build_and_insert_binop (gsi, loc, "powroot", RDIV_EXPR,
build_real (type, dconst1), result);
return result;
@@ -1340,7 +1337,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
static tree
gimple_expand_builtin_cabs (gimple_stmt_iterator *gsi, location_t loc, tree arg)
{
- tree target, real_part, imag_part, addend1, addend2, sum, result;
+ tree real_part, imag_part, addend1, addend2, sum, result;
tree type = TREE_TYPE (TREE_TYPE (arg));
tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
enum machine_mode mode = TYPE_MODE (type);
@@ -1351,17 +1348,16 @@ gimple_expand_builtin_cabs (gimple_stmt_iterator *gsi, location_t loc, tree arg)
|| optab_handler (sqrt_optab, mode) == CODE_FOR_nothing)
return NULL_TREE;
- target = create_tmp_reg (type, "cabs");
- real_part = build_and_insert_ref (gsi, loc, type, target,
+ real_part = build_and_insert_ref (gsi, loc, type, "cabs",
REALPART_EXPR, arg);
- addend1 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ addend1 = build_and_insert_binop (gsi, loc, "cabs", MULT_EXPR,
real_part, real_part);
- imag_part = build_and_insert_ref (gsi, loc, type, target,
+ imag_part = build_and_insert_ref (gsi, loc, type, "cabs",
IMAGPART_EXPR, arg);
- addend2 = build_and_insert_binop (gsi, loc, target, MULT_EXPR,
+ addend2 = build_and_insert_binop (gsi, loc, "cabs", MULT_EXPR,
imag_part, imag_part);
- sum = build_and_insert_binop (gsi, loc, target, PLUS_EXPR, addend1, addend2);
- result = build_and_insert_call (gsi, loc, &target, sqrtfn, sum);
+ sum = build_and_insert_binop (gsi, loc, "cabs", PLUS_EXPR, addend1, addend2);
+ result = build_and_insert_call (gsi, loc, sqrtfn, sum);
return result;
}
@@ -1894,12 +1890,9 @@ execute_optimize_bswap (void)
if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
{
gimple convert_stmt;
-
- bswap_tmp = create_tmp_var (bswap_type, "bswapsrc");
- bswap_tmp = make_ssa_name (bswap_tmp, NULL);
-
- convert_stmt = gimple_build_assign_with_ops (
- CONVERT_EXPR, bswap_tmp, bswap_src, NULL);
+ bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapsrc");
+ convert_stmt = gimple_build_assign_with_ops
+ (NOP_EXPR, bswap_tmp, bswap_src, NULL);
gsi_insert_before (&gsi, convert_stmt, GSI_SAME_STMT);
}
@@ -1911,11 +1904,9 @@ execute_optimize_bswap (void)
if (!useless_type_conversion_p (TREE_TYPE (bswap_tmp), bswap_type))
{
gimple convert_stmt;
-
- bswap_tmp = create_tmp_var (bswap_type, "bswapdst");
- bswap_tmp = make_ssa_name (bswap_tmp, NULL);
- convert_stmt = gimple_build_assign_with_ops (
- CONVERT_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
+ bswap_tmp = make_temp_ssa_name (bswap_type, NULL, "bswapdst");
+ convert_stmt = gimple_build_assign_with_ops
+ (NOP_EXPR, gimple_assign_lhs (stmt), bswap_tmp, NULL);
gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
}
@@ -2092,7 +2083,7 @@ is_widening_mult_p (gimple stmt,
static bool
convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
{
- tree lhs, rhs1, rhs2, type, type1, type2, tmp = NULL;
+ tree lhs, rhs1, rhs2, type, type1, type2;
enum insn_code handler;
enum machine_mode to_mode, from_mode, actual_mode;
optab op;
@@ -2161,22 +2152,14 @@ convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
return false;
if (actual_precision != TYPE_PRECISION (type1)
|| from_unsigned1 != TYPE_UNSIGNED (type1))
- {
- tmp = create_tmp_var (build_nonstandard_integer_type
- (actual_precision, from_unsigned1),
- NULL);
- rhs1 = build_and_insert_cast (gsi, loc, tmp, rhs1);
- }
+ rhs1 = build_and_insert_cast (gsi, loc,
+ build_nonstandard_integer_type
+ (actual_precision, from_unsigned1), rhs1);
if (actual_precision != TYPE_PRECISION (type2)
|| from_unsigned2 != TYPE_UNSIGNED (type2))
- {
- /* Reuse the same type info, if possible. */
- if (!tmp || from_unsigned1 != from_unsigned2)
- tmp = create_tmp_var (build_nonstandard_integer_type
- (actual_precision, from_unsigned2),
- NULL);
- rhs2 = build_and_insert_cast (gsi, loc, tmp, rhs2);
- }
+ rhs2 = build_and_insert_cast (gsi, loc,
+ build_nonstandard_integer_type
+ (actual_precision, from_unsigned2), rhs2);
/* Handle constants. */
if (TREE_CODE (rhs1) == INTEGER_CST)
@@ -2204,7 +2187,7 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
{
gimple rhs1_stmt = NULL, rhs2_stmt = NULL;
gimple conv1_stmt = NULL, conv2_stmt = NULL, conv_stmt;
- tree type, type1, type2, optype, tmp = NULL;
+ tree type, type1, type2, optype;
tree lhs, rhs1, rhs2, mult_rhs1, mult_rhs2, add_rhs;
enum tree_code rhs1_code = ERROR_MARK, rhs2_code = ERROR_MARK;
optab this_optab;
@@ -2373,25 +2356,19 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
actual_precision = GET_MODE_PRECISION (actual_mode);
if (actual_precision != TYPE_PRECISION (type1)
|| from_unsigned1 != TYPE_UNSIGNED (type1))
- {
- tmp = create_tmp_var (build_nonstandard_integer_type
- (actual_precision, from_unsigned1),
- NULL);
- mult_rhs1 = build_and_insert_cast (gsi, loc, tmp, mult_rhs1);
- }
+ mult_rhs1 = build_and_insert_cast (gsi, loc,
+ build_nonstandard_integer_type
+ (actual_precision, from_unsigned1),
+ mult_rhs1);
if (actual_precision != TYPE_PRECISION (type2)
|| from_unsigned2 != TYPE_UNSIGNED (type2))
- {
- if (!tmp || from_unsigned1 != from_unsigned2)
- tmp = create_tmp_var (build_nonstandard_integer_type
- (actual_precision, from_unsigned2),
- NULL);
- mult_rhs2 = build_and_insert_cast (gsi, loc, tmp, mult_rhs2);
- }
+ mult_rhs2 = build_and_insert_cast (gsi, loc,
+ build_nonstandard_integer_type
+ (actual_precision, from_unsigned2),
+ mult_rhs2);
if (!useless_type_conversion_p (type, TREE_TYPE (add_rhs)))
- add_rhs = build_and_insert_cast (gsi, loc, create_tmp_var (type, NULL),
- add_rhs);
+ add_rhs = build_and_insert_cast (gsi, loc, type, add_rhs);
/* Handle constants. */
if (TREE_CODE (mult_rhs1) == INTEGER_CST)