diff options
author | Adam Nemet <nemet@gcc.gnu.org> | 2009-07-09 05:32:21 +0000 |
---|---|---|
committer | Adam Nemet <nemet@gcc.gnu.org> | 2009-07-09 05:32:21 +0000 |
commit | 3f36bac24bce8dff4633e0238c94487f8d3d82ae (patch) | |
tree | fa860a534f9dd2bcd83ddd57eb70f6554a21c2e4 /gcc/combine.c | |
parent | ae30c1fa3d408d80ddae53efa00586ed45277120 (diff) | |
download | gcc-3f36bac24bce8dff4633e0238c94487f8d3d82ae.zip gcc-3f36bac24bce8dff4633e0238c94487f8d3d82ae.tar.gz gcc-3f36bac24bce8dff4633e0238c94487f8d3d82ae.tar.bz2 |
combine.c (make_extraction): Check TRULY_NOOP_TRUNCATION before creating LHS paradoxical subregs.
* combine.c (make_extraction): Check TRULY_NOOP_TRUNCATION before
creating LHS paradoxical subregs. Fix surrounding returns to
use NULL_RTX rather than 0.
From-SVN: r149401
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index a4f0d66..a781484 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6692,18 +6692,25 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, inner = adjust_address_nv (inner, wanted_inner_mode, offset); } - /* If INNER is not memory, we can always get it into the proper mode. If we - are changing its mode, POS must be a constant and smaller than the size - of the new mode. */ + /* If INNER is not memory, get it into the proper mode. If we are changing + its mode, POS must be a constant and smaller than the size of the new + mode. */ else if (!MEM_P (inner)) { + /* On the LHS, don't create paradoxical subregs implicitely truncating + the register unless TRULY_NOOP_TRUNCATION. */ + if (in_dest + && !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (inner)), + GET_MODE_BITSIZE (wanted_inner_mode))) + return NULL_RTX; + if (GET_MODE (inner) != wanted_inner_mode && (pos_rtx != 0 || orig_pos + len > GET_MODE_BITSIZE (wanted_inner_mode))) - return 0; + return NULL_RTX; if (orig_pos < 0) - return 0; + return NULL_RTX; inner = force_to_mode (inner, wanted_inner_mode, pos_rtx |