summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-18 19:57:15 +0000
committerams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-18 19:57:15 +0000
commit4333b41f6393fae00411ca6f25013a3a19508873 (patch)
tree84009255cba96a417776d629d3d13ce283453d15 /gcc/tree-ssa-math-opts.c
parent35ef44e37162f917976ffbe3a812909cef4836b3 (diff)
downloadgcc-4333b41f6393fae00411ca6f25013a3a19508873.tar.gz
2011-10-18 Andrew Stubbs <ams@codesourcery.com>
PR tree-optimization/50717 gcc/ * tree-ssa-math-opts.c (is_widening_mult_p): Remove the 'type' parameter. Calculate 'type' from stmt. (convert_mult_to_widen): Update call the is_widening_mult_p. (convert_plusminus_to_widen): Likewise. gcc/testsuite/ * gcc.dg/pr50717-1.c: New file. * gcc.target/arm/wmul-12.c: Correct types. * gcc.target/arm/wmul-8.c: Correct types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 02d91ca8bbd..75abb3369a1 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2039,10 +2039,12 @@ is_widening_mult_rhs_p (tree type, tree rhs, tree *type_out,
and *TYPE2_OUT would give the operands of the multiplication. */
static bool
-is_widening_mult_p (tree type, gimple stmt,
+is_widening_mult_p (gimple stmt,
tree *type1_out, tree *rhs1_out,
tree *type2_out, tree *rhs2_out)
{
+ tree type = TREE_TYPE (gimple_assign_lhs (stmt));
+
if (TREE_CODE (type) != INTEGER_TYPE
&& TREE_CODE (type) != FIXED_POINT_TYPE)
return false;
@@ -2104,7 +2106,7 @@ convert_mult_to_widen (gimple stmt, gimple_stmt_iterator *gsi)
if (TREE_CODE (type) != INTEGER_TYPE)
return false;
- if (!is_widening_mult_p (type, stmt, &type1, &rhs1, &type2, &rhs2))
+ if (!is_widening_mult_p (stmt, &type1, &rhs1, &type2, &rhs2))
return false;
to_mode = TYPE_MODE (type);
@@ -2281,7 +2283,7 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
if (code == PLUS_EXPR
&& (rhs1_code == MULT_EXPR || rhs1_code == WIDEN_MULT_EXPR))
{
- if (!is_widening_mult_p (type, rhs1_stmt, &type1, &mult_rhs1,
+ if (!is_widening_mult_p (rhs1_stmt, &type1, &mult_rhs1,
&type2, &mult_rhs2))
return false;
add_rhs = rhs2;
@@ -2289,7 +2291,7 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
}
else if (rhs2_code == MULT_EXPR || rhs2_code == WIDEN_MULT_EXPR)
{
- if (!is_widening_mult_p (type, rhs2_stmt, &type1, &mult_rhs1,
+ if (!is_widening_mult_p (rhs2_stmt, &type1, &mult_rhs1,
&type2, &mult_rhs2))
return false;
add_rhs = rhs1;