# DP: Two patches by Andreas Schwab to fix -fpic and loop optimization. # DP: Another patch by Andreas Schwab to fix %a5 restauration in some cases. ------------------------------------------------------------------------------ --- gcc/config/m68k/m68k.c~ Mon Aug 2 06:51:08 1999 +++ gcc/config/m68k/m68k.c Fri Oct 22 11:47:09 1999 @@ -356,7 +356,7 @@ mask &= ~ (1 << (15 - FRAME_POINTER_REGNUM)); num_saved_regs--; } - if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) + if (flag_pic && current_function_uses_pic_offset_table) { mask |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM); num_saved_regs++; @@ -493,7 +493,10 @@ for (regno = 0 ; regno < FIRST_PSEUDO_REGISTER ; regno++) if (regs_ever_live[regno] && ! call_used_regs[regno]) return 0; - + + if (flag_pic && current_function_uses_pic_offset_table) + return 0; + return 1; } @@ -568,7 +571,7 @@ nregs++; mask |= 1 << regno; } - if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) + if (flag_pic && current_function_uses_pic_offset_table) { nregs++; mask |= 1 << PIC_OFFSET_TABLE_REGNUM; @@ -1334,8 +1337,6 @@ gen_rtx_PLUS (Pmode, pic_offset_table_rtx, orig)); current_function_uses_pic_offset_table = 1; - if (reload_in_progress) - regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; RTX_UNCHANGING_P (pic_ref) = 1; emit_move_insn (reg, pic_ref); return reg; --- gcc/loop.c~ Fri Jun 25 06:38:11 1999 +++ gcc/loop.c Fri Oct 22 11:45:16 1999 @@ -4046,11 +4046,11 @@ in-between when biv_toal_increment returns nonzero both times but we test it here in case some day some real cfg analysis gets used to set always_computable. */ - && ((loop_insn_first_p (bl2->biv->insn, bl->biv->insn) - && no_labels_between_p (bl2->biv->insn, bl->biv->insn)) - || (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, - bl2->biv->insn) - && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) + && (loop_insn_first_p (bl2->biv->insn, bl->biv->insn) + ? no_labels_between_p (bl2->biv->insn, bl->biv->insn) + : (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, + bl2->biv->insn) + && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) && validate_change (bl->biv->insn, &SET_SRC (single_set (bl->biv->insn)), copy_rtx (src), 0))