diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2011-08-19 15:01:41 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2011-08-19 15:01:41 +0000 |
commit | 75161d2ca5a9a3c94e5c2ce6365046693a964368 (patch) | |
tree | 9b1018774c7a62489a737ecc1f5a3e86d81f5bef /gcc/tree-ssa-math-opts.c | |
parent | 6a228c2c0e38da47c08d70a90f41301b1278357a (diff) | |
download | gcc-75161d2ca5a9a3c94e5c2ce6365046693a964368.zip gcc-75161d2ca5a9a3c94e5c2ce6365046693a964368.tar.gz gcc-75161d2ca5a9a3c94e5c2ce6365046693a964368.tar.bz2 |
tree-ssa-math-opts.c (convert_plusminus_to_widen): Convert add_rhs to the correct type.
2011-08-19 Andrew Stubbs <ams@codesourcery.com>
gcc/
* tree-ssa-math-opts.c (convert_plusminus_to_widen): Convert add_rhs
to the correct type.
gcc/testsuite/
* gcc.target/arm/wmul-10.c: New file.
From-SVN: r177909
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 5ba31b5..73206ad 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -2369,6 +2369,10 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt, mult_rhs2 = build_and_insert_cast (gsi, loc, tmp, 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); + gimple_assign_set_rhs_with_ops_1 (gsi, wmult_code, mult_rhs1, mult_rhs2, add_rhs); update_stmt (gsi_stmt (*gsi)); |