Commit dcf8468f by Andrew Pinski Committed by Andrew Pinski

simplify-rtx.c (simplify_unary_operation_1 <case TRUNCATE>): A truncate of a…

simplify-rtx.c (simplify_unary_operation_1 <case TRUNCATE>): A truncate of a memory is just loading the low part of the memory.

2012-09-01  Andrew Pinski  <apinski@cavium.com>

	* simplify-rtx.c (simplify_unary_operation_1 <case TRUNCATE>):
	A truncate of a memory is just loading the low part of the memory.

2012-09-01  Andrew Pinski  <apinski@cavium.com>

        * gcc.target/mips/truncate-8.c: New testcase.

From-SVN: r190848
parent 2caf633d
2012-09-01 Andrew Pinski <apinski@cavium.com>
* simplify-rtx.c (simplify_unary_operation_1 <case TRUNCATE>):
A truncate of a memory is just loading the low part of the memory.
2012-09-01 Uros Bizjak <ubizjak@gmail.com>
PR target/46829
......
......@@ -869,6 +869,14 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
&& COMPARISON_P (op)
&& (STORE_FLAG_VALUE & ~GET_MODE_MASK (mode)) == 0)
return rtl_hooks.gen_lowpart_no_emit (mode, op);
/* A truncate of a memory is just loading the low part of the memory
if we are not changing the meaning of the address. */
if (GET_CODE (op) == MEM
&& !MEM_VOLATILE_P (op)
&& !mode_dependent_address_p (XEXP (op, 0)))
return rtl_hooks.gen_lowpart_no_emit (mode, op);
break;
case FLOAT_TRUNCATE:
......
2012-09-01 Andrew Pinski <apinski@cavium.com>
* gcc.target/mips/truncate-8.c: New testcase.
2012-09-01 Uros Bizjak <ubizjak@gmail.com>
PR target/46829
......
/* { dg-options "-mgp64" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
/* { dg-final { scan-assembler "\tlw\t" } } */
/* { dg-final { scan-assembler-not "\tsll\t" } } */
/* { dg-final { scan-assembler-not "\tld\t" } } */
struct s
{
long long a;
int b;
};
int
foo (struct s *x)
{
return x->a;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment