summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-03 17:33:31 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-03 17:33:31 +0000
commit1729795338c551f7697f647d5f3a59dd0f547eb2 (patch)
treec41ccdf4f2a83d3a7481104e5f49d0bedf5f94fc /gcc/tree-tailcall.c
parenta81d7200fe395b9208f758c99a38929e5957ce0c (diff)
downloadgcc-1729795338c551f7697f647d5f3a59dd0f547eb2.tar.gz
* tree-tailcall.c (find_tail_calls): Convert the operands to the type
of the result before building binary expressions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166260 138bc75d-0d04-0410-961f-82ee72b054a4
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);
}
}