re PR tree-optimization/54295 (Widening multiply-accumulate operation uses wrong value extension)

PR tree-ssa/54295
	* tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
	Sign-extension of a zero-extended value can be simplified to
	just zero-extension.

testsuite:
	* gcc.target/arm/pr50318-1.c: Scan for smlal.
	* gcc.target/arm/smlaltb-1.c: XFAIL test.
	* gcc.target/arm/smlaltt-1.c: Likewise.

From-SVN: r191066
This commit is contained in:
Richard Earnshaw 2012-09-07 10:37:08 +00:00 committed by Richard Earnshaw
parent 81ab73121e
commit e919e5bffb
6 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2012-09-07 Richard Earnshaw <rearnsha@arm.com>
PR tree-ssa/54295
* tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
Sign-extension of a zero-extended value can be simplified to
just zero-extension.
2012-09-07 Richard Guenther <rguenther@suse.de>
PR middle-end/53667

View File

@ -1,3 +1,9 @@
2012-09-07 Richard Earnshaw <rearnsha@arm.com>
* gcc.target/arm/pr50318-1.c: Scan for smlal.
* gcc.target/arm/smlaltb-1.c: XFAIL test.
* gcc.target/arm/smlaltt-1.c: Likewise.
2012-09-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/pr44194-1.c: Skip on Alpha and adjust regexp for SPARC64.

View File

@ -8,4 +8,4 @@ long long test (unsigned int sec, unsigned long long nsecs)
long)nsecs;
}
/* { dg-final { scan-assembler "umlal" } } */
/* { dg-final { scan-assembler "smlal" } } */

View File

@ -11,4 +11,4 @@ foo (long long x, int in)
return x + b * a;
}
/* { dg-final { scan-assembler "smlaltb\\t" } } */
/* { dg-final { scan-assembler "smlaltb\\t" { xfail *-*-* } } } */

View File

@ -11,4 +11,4 @@ foo (long long x, int in1, int in2)
return x + b * a;
}
/* { dg-final { scan-assembler "smlaltt\\t" } } */
/* { dg-final { scan-assembler "smlaltt\\t" { xfail *-*-* } } } */

View File

@ -1985,7 +1985,11 @@ widening_mult_conversion_strippable_p (tree result_type, gimple stmt)
the operation and doesn't narrow the range. */
inner_op_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
if (TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type)
/* If the inner-most type is unsigned, then we can strip any
intermediate widening operation. If it's signed, then the
intermediate widening operation must also be signed. */
if ((TYPE_UNSIGNED (inner_op_type)
|| TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type))
&& TYPE_PRECISION (op_type) > TYPE_PRECISION (inner_op_type))
return true;