aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2011-08-19 14:41:34 +0000
committerAndrew Stubbs <ams@gcc.gnu.org>2011-08-19 14:41:34 +0000
commitff63d754c170a5540fd48fa76428da3fc9e0c073 (patch)
tree26a12e3f6880c3f74c043a86eb86c912e2b606fc /gcc/tree-ssa-math-opts.c
parentdb719f507b09c42d169a49f0383b54f32e482606 (diff)
downloadgcc-ff63d754c170a5540fd48fa76428da3fc9e0c073.zip
gcc-ff63d754c170a5540fd48fa76428da3fc9e0c073.tar.gz
gcc-ff63d754c170a5540fd48fa76428da3fc9e0c073.tar.bz2
tree-ssa-math-opts.c (is_widening_mult_p): Remove FIXME.
2011-08-19 Andrew Stubbs <ams@codesourcery.com> gcc/ * tree-ssa-math-opts.c (is_widening_mult_p): Remove FIXME. Ensure the the larger type is the first operand. gcc/testsuite/ * gcc.target/arm/wmul-7.c: New file. From-SVN: r177906
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 0505603..cc0da29 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2054,9 +2054,17 @@ is_widening_mult_p (gimple stmt,
*type2_out = *type1_out;
}
- /* FIXME: remove this restriction. */
- if (TYPE_PRECISION (*type1_out) != TYPE_PRECISION (*type2_out))
- return false;
+ /* Ensure that the larger of the two operands comes first. */
+ if (TYPE_PRECISION (*type1_out) < TYPE_PRECISION (*type2_out))
+ {
+ tree tmp;
+ tmp = *type1_out;
+ *type1_out = *type2_out;
+ *type2_out = tmp;
+ tmp = *rhs1_out;
+ *rhs1_out = *rhs2_out;
+ *rhs2_out = tmp;
+ }
return true;
}