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]

Re: Painful problems with -fpic implementation on powerpc-sysv


On Wed, Aug 26, 1998 at 01:11:02AM -0600, Jeffrey A Law wrote:
> This could work for cases where one is trying to build up a constant,
> but would not work if (for example) reload decided try and put
> (const (plus (symbol_ref) (offset)) into the constant pool.  Yes, this
> does really happen and it is painful.

If this happens, it is a bug.  With -fpic, a symbol_ref is not a
constant, and will result in a run-time relocation to .rodata.
Not good.

This should instead be reloaded as

	(set tmp (mem:PI pic (symbol_ref)))
	(set tmp (plus:PI tmp (offset)))

splitting up the first as dictated by -fpic vs -fPIC.


r~


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