diff options
author | ams <ams@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-19 15:01:41 +0000 |
---|---|---|
committer | ams <ams@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-19 15:01:41 +0000 |
commit | 124215450f37f30fc5e2ebd9c16c28c0d6542768 (patch) | |
tree | 9b1018774c7a62489a737ecc1f5a3e86d81f5bef /gcc/tree-ssa-math-opts.c | |
parent | 22ffd684d3d01a1780755c665d9ce415cd2a8416 (diff) | |
download | gcc-124215450f37f30fc5e2ebd9c16c28c0d6542768.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177909 138bc75d-0d04-0410-961f-82ee72b054a4
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 5ba31b560b5..73206adceba 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)); |