[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Has anyone successfully bootstrapped gcc-4.6.3 on m68k?



On 01/06/2012 22:01, Vaugha Brewchuk wrote:
I finally have some good news and good progress with gcc-4.2.4.

Good.

On a related note, the difference between assembly code generated by my
NeXT ports of gcc-3.2.3 and 4.6.3 for jump tables is as follows (I
changed the label numbers for clarity):

Actually, there are 2 different issues:

1) Reference from the .text program to the jump table
- relative to pc: can't work with different section
- absolute: will always work

2) Reference from the jump table to the .text label
- relative to the jump instruction: can work if computed carefully
- absolute: will always work

That being said:

gcc-3.2.3 (works fine):

	movel a6@(-4),d0
	lsll #2,d0
	movel #L9,a0
	movel a0@(d0:l),a0
	jmp a0@
	.const
	.align 1
L9:
	.long L8
	.long L3

Good.
- The jump table is in the .const section.
- The .text program references the jump table in absolute way
- The jump table references the .text labels in absolute way
This is optimal.

gcc-4.6.3 (bus errors):

	movel pc@(L9,d0:l),d0
	movel d0,a0
	jmp a0@
	.const
	.align 1
L9:
	.long L8
	.long L3

Wrong.
- The jump table is in the .const section
- The .text program references the jump table in *pc-relative* way
- The jump table references the .text labels in absolute way
This can't work because the jump table is in a different section and is referenced in a pc-relative way.

You have to determine how to change :
        movel pc@(L9,d0:l),d0
        movel d0,a0
to:
        movel #L9,a0

Good luck.

--
Vincent Rivière


Reply to: