This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Use simplify_gen_unary in gen_lowpart_or_truncate
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Feb 2006 14:45:00 -0800
- Subject: [patch] Use simplify_gen_unary in gen_lowpart_or_truncate
Now that the related latent bug is fixed I can call simplify_gen_unary
in gen_lowpart_or_truncate to generate TRUNCATEs.
I couldn't measure any difference in the assembly output generated
before and after the patch but hopefully this situation will improve
in the future.
Tested on mipsisa64-elf and tested and bootstrapped on
i686-pc-linux-gnu.
OK to apply?
Adam
* combine.c (gen_lowpart_or_truncate): Call
simplify_gen_unary(TRUNCATE, ...) instead of gen_rtx_TRUNCATE.
Index: combine.c
===================================================================
--- combine.c (revision 110871)
+++ combine.c (working copy)
@@ -6773,7 +6773,7 @@ gen_lowpart_or_truncate (enum machine_mo
|| (REG_P (x) && reg_truncated_to_mode (mode, x)))
return gen_lowpart (mode, x);
else
- return gen_rtx_TRUNCATE (mode, x);
+ return simplify_gen_unary (TRUNCATE, mode, x, GET_MODE (x));
}
/* See if X can be simplified knowing that we will only refer to it in