bfd Patch for -relax on sh-hms

Dave Brolley
Wed Feb 2 15:44:00 GMT 2000


This patch prevents the linker from switching the order of the
two insns in the test below when -relax is specified for the
sh-hms target. It does this by checking for interference between
both the source and target registers of each insn pair being
considered. Here is the test case

        .align  2
        mov     r2,r1
        mov.l   L1,r1
L1:     .long   0

If this patch is OK, could someone please commit it and let me
know. I don't have write access to binutils. Also, I'm not
subscribed to this list, so please email me directly.

Dave Brolley
Wed Jan  5 13:18:04 PST 2000  Toshiyasu Morita (

        * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG,
        USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros.
        * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes.
        * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg,
        sh_insns_uses_or_sets_freg): New functions.
        * (sh_insn_uses_regs, sh_insn_uses_freg): Use new macros.
        * (sh_insns_conflict): Use new functions and new macros to 
        detect conflicts when two instructions both set same integer registers,
        both set same fp register, and both set special register.

More information about the Binutils mailing list