From e207e41f47355476c36f5833796e62dcdeab1482 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 26 Jul 2011 20:03:54 +0200 Subject: [PATCH] re PR target/47369 ([x32] internal compiler error: in extract_insn, at recog.c:2109) PR target/47369 PR target/49853 * config/i386/i386.c (ix86_expand_move): Call convert_to_mode if legitimize_tls_address returned operand in wrong mode. Allow SImode and DImode symbolic operand for PIC. Call convert_to_mode if legitimize_pic_address returned operand in wrong mode. Co-Authored-By: H.J. Lu From-SVN: r176798 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/i386/i386.c | 11 ++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc2fd587c1b..06e00746f8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-07-26 Uros Bizjak + H.J. Lu + + PR target/47369 + PR target/49853 + * config/i386/i386.c (ix86_expand_move): Call convert_to_mode + if legitimize_tls_address returned operand in wrong mode. Allow + SImode and DImode symbolic operand for PIC. Call convert_to_mode + if legitimize_pic_address returned operand in wrong mode. + 2011-07-26 Martin Jambor * tree-sra.c (tree_non_mode_aligned_mem_p): Strip conversions and diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3668357e290..429cd6271ca 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -15028,11 +15028,14 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) op0, 1, OPTAB_DIRECT); if (tmp == op0) return; + if (GET_MODE (tmp) != mode) + op1 = convert_to_mode (mode, tmp, 1); } } if ((flag_pic || MACHOPIC_INDIRECT) - && mode == Pmode && symbolic_operand (op1, Pmode)) + && (mode == SImode || mode == DImode) + && symbolic_operand (op1, mode)) { if (TARGET_MACHO && !TARGET_64BIT) { @@ -15073,13 +15076,15 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) else { if (MEM_P (op0)) - op1 = force_reg (Pmode, op1); - else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, Pmode)) + op1 = force_reg (mode, op1); + else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, mode)) { rtx reg = can_create_pseudo_p () ? NULL_RTX : op0; op1 = legitimize_pic_address (op1, reg); if (op0 == op1) return; + if (GET_MODE (op1) != mode) + op1 = convert_to_mode (mode, op1, 1); } } } -- 2.30.2