This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: d30v bsr bundling problem


Hi Richard,

:         bsr.s/fx        foo
:         ldw.s           r34, @(sp+, r0)
: 
: The assembler was bundling this as
: 
: 	bsr.s/fx -> ldw.s
: 
: which doesn't work, as the link register receives the address
: of the next bundle.  This patch fixes it, but I'm uncertain 
: what case the removed code was supposed to be handling.  The
: comment doesn't seem to cover it.
: 
: Thoughts?
:
:         else if ((opcode1->op->flags_used & (FLAG_JMP | FLAG_JSR)
: ! 		&& ((opcode1->op->flags_used & FLAG_DELAY) == 0)
: ! 		&& ((opcode1->ecc == ECC_AL) || ! Optimizing))
:   	       || opcode1->op->flags_used & FLAG_RP)
:   	{
:   	  /* We must emit (non-delayed) branch type instructions
: --- 814,820 ----
:   	    }
:   	}
:         else if ((opcode1->op->flags_used & (FLAG_JMP | FLAG_JSR)
: ! 		&& ((opcode1->op->flags_used & FLAG_DELAY) == 0))
:   	       || opcode1->op->flags_used & FLAG_RP)
:   	{
:   	  /* We must emit (non-delayed) branch type instructions


The deleted line was attempt to implement a feature requested by
Mitsubishi.  They asked that GAS should:

 >   (A)  Warn and avoid  	"Branches (always) ->  Any inst."
 >   (B)  Warn and avoid also  	"Branches (conditional) -> Any inst"
 >  
 > We want GAS to use either of (A) or (B) depending on the given
 > option.  With -O specified, GAS use the rule (A): it warns and
 > avoids codes like "bra -> add" whereas it accepts and produces code
 > like "bra/tx -> bra".  Without -O, on the other hand, GAS use the
 > rule (B), so it warns and avoids code like "bra/tx ->bra".

It turns out however, that this line is unnecessary (and wrong) since
the test is only supposed to be performed on instructions whoes
packing has been explictly specified by the assembly language
programmer.  [There is a duplicate of this line slightly earlier on in
the code that is correct.  That line even has a comment associated
with it.]

So please do go ahead and apply your patch.

Cheers
	Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]