This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

[Patch] Error in config/sh/crt1.asm


The following patch is required because in the SH architecture, a move
instruction that uses PC-relative addressing is not permitted to
appear in branch delay slots.  There aren't any other useful
instructions to schedule into the delay slot, so I've inserted a nop.

Tested on i686-pc-linux-gnu cross sh-elf.

Okay to commit?


2000-11-17  Ben Elliston  <bje@redhat.com>

	* crt1.asm (start_l): Move PC-relative move instruction out of a
	branch delay slot.


*** crt1.asm	2000/09/02 03:28:47	1.1
--- crt1.asm	2000/11/17 01:40:34
*************** start_l:
*** 51,58 ****
  
  	! arrange for exit to call fini
  	mov.l	atexit_k,r0
- 	jsr	@r0
  	mov.l	fini_k,r4
  
  	! call init
  	mov.l	init_k,r0
--- 51,59 ----
  
  	! arrange for exit to call fini
  	mov.l	atexit_k,r0
  	mov.l	fini_k,r4
+ 	jsr	@r0
+ 	nop
  
  	! call init
  	mov.l	init_k,r0

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