summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-13 22:13:07 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-13 22:13:07 +0000
commitac9db7eb0ee0587d6516344967ce936d29f71952 (patch)
tree2f6993a5122c450524b49fbe107c8f433c414d67
parente4ea1ced49111c9110f410f9820c5e2a8f4feb71 (diff)
downloadgcc-ac9db7eb0ee0587d6516344967ce936d29f71952.tar.gz
PR bootstrap/10983
* combine.c (make_extraction): Use gen_lowpart_for_combine when extracting from a REG and not in the destination of a SET. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67916 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c49
2 files changed, 34 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c526f71cd7b..9a5424692e3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-06-13 Jim Wilson <wilson@tuliptree.org>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR bootstrap/10983
+ * combine.c (make_extraction): Use gen_lowpart_for_combine
+ when extracting from a REG and not in the destination of a SET.
+
2003-06-13 Doug Evans <dje@sebabeach.org>
* tsystem.h (abort): Declare in inhibit_libc case to remove build
diff --git a/gcc/combine.c b/gcc/combine.c
index 3e2f089bed9..16385767e66 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6139,30 +6139,35 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
}
else if (GET_CODE (inner) == REG)
{
- /* We can't call gen_lowpart_for_combine here since we always want
- a SUBREG and it would sometimes return a new hard register. */
if (tmode != inner_mode)
{
- HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
-
- if (WORDS_BIG_ENDIAN
- && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
- final_word = ((GET_MODE_SIZE (inner_mode)
- - GET_MODE_SIZE (tmode))
- / UNITS_PER_WORD) - final_word;
-
- final_word *= UNITS_PER_WORD;
- if (BYTES_BIG_ENDIAN &&
- GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
- final_word += (GET_MODE_SIZE (inner_mode)
- - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
-
- /* Avoid creating invalid subregs, for example when
- simplifying (x>>32)&255. */
- if (final_word >= GET_MODE_SIZE (inner_mode))
- return NULL_RTX;
-
- new = gen_rtx_SUBREG (tmode, inner, final_word);
+ if (in_dest)
+ {
+ /* We can't call gen_lowpart_for_combine here since we always want
+ a SUBREG and it would sometimes return a new hard register. */
+ HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
+
+ if (WORDS_BIG_ENDIAN
+ && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
+ final_word = ((GET_MODE_SIZE (inner_mode)
+ - GET_MODE_SIZE (tmode))
+ / UNITS_PER_WORD) - final_word;
+
+ final_word *= UNITS_PER_WORD;
+ if (BYTES_BIG_ENDIAN &&
+ GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
+ final_word += (GET_MODE_SIZE (inner_mode)
+ - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
+
+ /* Avoid creating invalid subregs, for example when
+ simplifying (x>>32)&255. */
+ if (final_word >= GET_MODE_SIZE (inner_mode))
+ return NULL_RTX;
+
+ new = gen_rtx_SUBREG (tmode, inner, final_word);
+ }
+ else
+ new = gen_lowpart_for_combine (tmode, inner);
}
else
new = inner;