On Tue, 18 Nov 2014, Andrew Bennett wrote:

> The atomic-compare-exchange-3.c and atomic-op-3.c tests are failing when
> using the -mfix-r10000 option.  This is due to the fact that the delay 
> slot of the branch instruction that checks if the atomic operation was
> not successful can be filled with an operation that returns the output 
> result.  For the branch likely case this operation can not go in the 
> delay slot because it wont execute when the atomic operation was 
> successful and therefore the wrong result will be returned.  This patch 
> forces a nop to be placed in the delay slot if a branch likely is used.  
> The fix is as simple as possible; it does cause a second nop to be introduced 
> after the branch instruction in the branch likely case.  As this option is 
> rarely used, it makes more sense to keep the code readable than trying to 
> optimise it.

 Can you please be a bit more elaborate on how the wrong code sequence 
looks like, why it is produced like that and how your fix changes it?  
Without seeing examples of code generated it is very hard to imagine 
what is really going on here.

  Maciej

Reply via email to