aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2009-07-18 21:55:40 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2009-07-18 21:55:40 +0000
commit827f4079406b72fce7b49a29abe60ecb801462d5 (patch)
tree31910105b61e164fdc184c5ff130eb63a48de118 /gcc/combine.c
parentf3ce108897e16f828b3350ac5c5be9d0ffc622c0 (diff)
downloadgcc-827f4079406b72fce7b49a29abe60ecb801462d5.zip
gcc-827f4079406b72fce7b49a29abe60ecb801462d5.tar.gz
gcc-827f4079406b72fce7b49a29abe60ecb801462d5.tar.bz2
combine.c (make_compound_operation): If force_to_mode re-expanded the compound use gen_lowpart instead to convert to...
* combine.c (make_compound_operation) <SUBREG>: If force_to_mode re-expanded the compound use gen_lowpart instead to convert to the desired mode. testsuite/ * gcc.target/mips/ext-2.c: New test. From-SVN: r149781
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 39daf28..3f39bc3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -7061,6 +7061,12 @@ make_compound_operation (rtx x, enum rtx_code in_code)
if (GET_CODE (newer) != SUBREG)
newer = make_compound_operation (newer, in_code);
+ /* force_to_mode can expand compounds. If it just re-expanded the
+ compound use gen_lowpart instead to convert to the desired
+ mode. */
+ if (rtx_equal_p (newer, x))
+ return gen_lowpart (GET_MODE (x), tem);
+
return newer;
}