summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 22:36:11 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 22:36:11 +0000
commitd97f844f4b9c2c897e6c5c12f05efeb51ddbb618 (patch)
treee057064fc22cbc5f50acaba03e7fbf4318fc522d
parentd88c9c8d653dc41c945b11443f696b0073249be5 (diff)
downloadgcc-d97f844f4b9c2c897e6c5c12f05efeb51ddbb618.tar.gz
Convert to Pmode if needed in ix86_legitimize_address.
2011-07-21 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_legitimize_address): Convert to Pmode if needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176595 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf529042bf2..3daa0727f16 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2011-07-21 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.c (ix86_legitimize_address): Convert to
+ Pmode if needed.
+
+2011-07-21 H.J. Lu <hongjiu.lu@intel.com>
+
* config/i386/i386.c (function_value_64): Always return pointers
in Pmode.
(ix86_promote_function_mode): New.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 957b51d6fc8..f1803c39a3c 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -12644,7 +12644,11 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx temp = gen_reg_rtx (Pmode);
rtx val = force_operand (XEXP (x, 1), temp);
if (val != temp)
- emit_move_insn (temp, val);
+ {
+ if (GET_MODE (val) != Pmode)
+ val = convert_to_mode (Pmode, val, 1);
+ emit_move_insn (temp, val);
+ }
XEXP (x, 1) = temp;
return x;
@@ -12655,7 +12659,11 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
rtx temp = gen_reg_rtx (Pmode);
rtx val = force_operand (XEXP (x, 0), temp);
if (val != temp)
- emit_move_insn (temp, val);
+ {
+ if (GET_MODE (val) != Pmode)
+ val = convert_to_mode (Pmode, val, 1);
+ emit_move_insn (temp, val);
+ }
XEXP (x, 0) = temp;
return x;