combine.c (combine_simplify_rtx): Remove TRULY_NOOP_TRUNCATION check when calling force_to_mode on TRUNCATE's operand.

* combine.c (combine_simplify_rtx): Remove TRULY_NOOP_TRUNCATION
	check when calling force_to_mode on TRUNCATE's operand.

testsuite/
	* gcc.target/mips/truncate-3.c: New test.

From-SVN: r148827
This commit is contained in:
Adam Nemet 2009-06-23 00:31:44 +00:00 committed by Adam Nemet
parent 2fc61b4b32
commit cfb8805e0f
4 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-06-22 Adam Nemet <anemet@caviumnetworks.com>
* combine.c (combine_simplify_rtx): Remove TRULY_NOOP_TRUNCATION
check when calling force_to_mode on TRUNCATE's operand.
2009-06-22 Ian Lance Taylor <iant@google.com>
* config/rs6000/rs6000.opt: Move msched-epilog before

View File

@ -4889,9 +4889,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest)
if (GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
break;
if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))))
if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
SUBST (XEXP (x, 0),
force_to_mode (XEXP (x, 0), GET_MODE (XEXP (x, 0)),
GET_MODE_MASK (mode), 0));

View File

@ -1,3 +1,7 @@
2009-06-22 Adam Nemet <anemet@caviumnetworks.com>
* gcc.target/mips/truncate-3.c: New test.
2009-06-22 Janus Weil <janus@gcc.gnu.org>
PR fortran/37254

View File

@ -0,0 +1,11 @@
/* Remove redundant operations in truncate's operand. */
/* { dg-options "-O -mgp64" } */
/* { dg-final { scan-assembler-not "\tandi?\t" } } */
f (long long d)
{
long long c = d & 0xffffffffff;
int i = (int) c;
g (i);
}