From: J"orn Rennecke Date: Mon, 21 Jun 1999 19:21:48 +0000 (+0000) Subject: sh.c (machine_dependent_reorg): When fixing up fp pcloads... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8794099b71a90b1a2d336b30fac802aba82345b;p=gcc.git sh.c (machine_dependent_reorg): When fixing up fp pcloads... * sh.c (machine_dependent_reorg): When fixing up fp pcloads, remove the clobber of r0 and change the REG_UNUSED note to REG_INC. From-SVN: r27676 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d76c2c73cb..f176d7a50dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Tue Jun 22 03:17:53 1999 J"orn Rennecke + + * sh.c (machine_dependent_reorg): When fixing up fp pcloads, + remove the clobber of r0 and change the REG_UNUSED note to + REG_INC. + 1999-06-21 Jakub Jelinek * real.c (ereal_from_double): Fix for 64-bit big endian hosts. diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 6181783e9e8..7ebaa4dabfc 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -3098,6 +3098,14 @@ machine_dependent_reorg (first) && REGNO (dst) <= LAST_XD_REG) || REGNO (dst) == FPUL_REG)) { + /* This must be an insn that clobbers r0. */ + rtx clobber = XVECEXP (PATTERN (scan), 0, + XVECLEN (PATTERN (scan), 0) - 1); + + if (GET_CODE (clobber) != CLOBBER + || ! rtx_equal_p (XEXP (clobber, 0), r0_rtx)) + abort (); + if (last_float && reg_set_between_p (r0_rtx, last_float_move, scan)) last_float = 0; @@ -3105,7 +3113,19 @@ machine_dependent_reorg (first) if (lab) emit_insn_before (gen_mova (lab), scan); else - *last_float_addr = r0_inc_rtx; + { + /* There will be a REG_UNUSED note for r0 on + LAST_FLOAT_MOVE; we have to change it to REG_INC, + lest reorg:mark_target_live_regs will not + consider r0 to be used, and we end up with delay + slot insn in front of SCAN that clobber r0. */ + rtx note + = find_regno_note (last_float_move, REG_UNUSED, 0); + + PUT_MODE (note, REG_INC); + + *last_float_addr = r0_inc_rtx; + } last_float_move = scan; last_float = src; newsrc = gen_rtx (MEM, mode, @@ -3114,6 +3134,9 @@ machine_dependent_reorg (first) ? r0_inc_rtx : r0_rtx)); last_float_addr = &XEXP (newsrc, 0); + + /* Remove the clobber of r0. */ + XEXP (clobber, 0) = gen_rtx_SCRATCH (Pmode); } else {