2011-08-19 Andrew Stubbs <ams@codesourcery.com>
+ * tree-ssa-math-opts.c (convert_plusminus_to_widen): Convert add_rhs
+ to the correct type.
+
+2011-08-19 Andrew Stubbs <ams@codesourcery.com>
+
* tree-ssa-math-opts.c (convert_mult_to_widen): Better handle
unsigned inputs of different modes.
(convert_plusminus_to_widen): Likewise.
2011-08-19 Andrew Stubbs <ams@codesourcery.com>
+ * gcc.target/arm/wmul-10.c: New file.
+
+2011-08-19 Andrew Stubbs <ams@codesourcery.com>
+
* gcc.target/arm/wmul-9.c: New file.
* gcc.target/arm/wmul-bitfield-2.c: New file.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target arm_dsp } */
+
+
+unsigned long long
+foo (unsigned short a, unsigned short *b, unsigned short *c)
+{
+ return (unsigned)a + (unsigned long long)*b * (unsigned long long)*c;
+}
+
+/* { dg-final { scan-assembler "umlal" } } */
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));