summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-11-03 17:33:31 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-11-03 17:33:31 +0000
commitfdb8b4c025aaec6ef208c0af698cc3faa87d15dd (patch)
treec41ccdf4f2a83d3a7481104e5f49d0bedf5f94fc /gcc/tree-tailcall.c
parent5554928d3d05201ad1b0c826c5221ead783f765f (diff)
downloadgcc-fdb8b4c025aaec6ef208c0af698cc3faa87d15dd.tar.gz
tree-tailcall.c (find_tail_calls): Convert the operands to the type of the result before building binary expressions.
* tree-tailcall.c (find_tail_calls): Convert the operands to the type of the result before building binary expressions. From-SVN: r166260
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 38daed9a786..10ae450886f 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -532,20 +532,22 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
if (tmp_a)
{
+ tree type = TREE_TYPE (tmp_a);
if (a)
- a = fold_build2 (PLUS_EXPR, TREE_TYPE (tmp_a), a, tmp_a);
+ a = fold_build2 (PLUS_EXPR, type, fold_convert (type, a), tmp_a);
else
a = tmp_a;
}
if (tmp_m)
{
+ tree type = TREE_TYPE (tmp_m);
if (m)
- m = fold_build2 (MULT_EXPR, TREE_TYPE (tmp_m), m, tmp_m);
+ m = fold_build2 (MULT_EXPR, type, fold_convert (type, m), tmp_m);
else
m = tmp_m;
if (a)
- a = fold_build2 (MULT_EXPR, TREE_TYPE (tmp_m), a, tmp_m);
+ a = fold_build2 (MULT_EXPR, type, fold_convert (type, a), tmp_m);
}
}