From fdb8b4c025aaec6ef208c0af698cc3faa87d15dd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 3 Nov 2010 17:33:31 +0000 Subject: 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 --- gcc/tree-tailcall.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/tree-tailcall.c') diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 38daed9..10ae450 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); } } -- cgit v1.1