Saga of m68k PIC continues

Richard Henderson rth@redhat.com
Thu Dec 12 02:41:00 GMT 2002


On Wed, Dec 11, 2002 at 07:11:05PM -0500, Peter Barada wrote:
> +	case 7:
> +	  fputs ("@GOTOFF", file);
> +	  break;

Note that m68k doesn't have @GOTOFF.  The equivalent there
is pc-relative addressing modes.

Ideally, m68k pic code generation would use @GOTPC, a-la

	extern int foo;
	foo = 1;

	movel	(%pc, foo@GOTPC), %a0
	moveql	#1, (%a0)

	static int bar, baz;
	bar = baz;

	lea	(%pc, bar), %a0
	movel	(%pc, baz), (%a0)

I can't really think of any reason that 68020+ would
actually need a pic register.  For 68000 and coldfire
I guess you need one because of the limited range of
the pc-relative offsets.


r~



More information about the Gcc mailing list