From 628c1ac95a382b5f53a8a26a8757d9df4cad7684 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 21 Jul 2011 22:36:11 +0000 Subject: [PATCH] Convert to Pmode if needed in ix86_legitimize_address. 2011-07-21 H.J. Lu * config/i386/i386.c (ix86_legitimize_address): Convert to Pmode if needed. From-SVN: r176595 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 12 ++++++++++-- 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,3 +1,8 @@ +2011-07-21 H.J. Lu + + * config/i386/i386.c (ix86_legitimize_address): Convert to + Pmode if needed. + 2011-07-21 H.J. Lu * config/i386/i386.c (function_value_64): Always return pointers 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; -- 2.30.2