This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Saga of m68k PIC continues


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~


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