From: drow Date: Sun, 17 Nov 2002 22:33:31 +0000 (+0000) Subject: * sh.c (gen_shl_and): Don't create a zero_extend if the operand X-Git-Tag: upstream/4.9.2~83388 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=925cf7ab585f432e5297e373aadaf3da078bd75a;p=platform%2Fupstream%2Flinaro-gcc.git * sh.c (gen_shl_and): Don't create a zero_extend if the operand is not an arith_reg_operand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59201 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6434f60..f27dedb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-11-17 Daniel Jacobowitz + + * sh.c (gen_shl_and): Don't create a zero_extend if the operand + is not an arith_reg_operand. + 2002-11-17 Graham Stott * real.c (real_to_decimal): Fix buffer overrun when buffer size diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index d2cc471..0ce5e06 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1823,11 +1823,16 @@ gen_shl_and (dest, left_rtx, mask_rtx, source) if (first < 0) { + enum machine_mode mode + = ((mask << right) <= 0xff) ? QImode : HImode; + rtx lowpart = gen_lowpart (mode, source); + + if (no_new_pseudos && ! TARGET_SHMEDIA + && ! arith_reg_operand (lowpart, mode)) + return -1; emit_insn ((mask << right) <= 0xff - ? gen_zero_extendqisi2(dest, - gen_lowpart (QImode, source)) - : gen_zero_extendhisi2(dest, - gen_lowpart (HImode, source))); + ? gen_zero_extendqisi2(dest, lowpart) + : gen_zero_extendhisi2(dest, lowpart)); source = dest; } if (source != dest) @@ -1846,9 +1851,18 @@ gen_shl_and (dest, left_rtx, mask_rtx, source) mask <<= first; } if (first >= 0) - emit_insn (mask <= 0xff - ? gen_zero_extendqisi2(dest, gen_lowpart (QImode, dest)) - : gen_zero_extendhisi2(dest, gen_lowpart (HImode, dest))); + { + enum machine_mode mode = (mask <= 0xff) ? QImode : HImode; + rtx lowpart = gen_lowpart (mode, dest); + + if (no_new_pseudos && ! TARGET_SHMEDIA + && ! arith_reg_operand (lowpart, mode)) + return -1; + emit_insn (mask <= 0xff + ? gen_zero_extendqisi2(dest, lowpart) + : gen_zero_extendhisi2(dest, lowpart)); + } + if (total_shift > 0) { operands[2] = GEN_INT (total_shift);