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]

Re: [PATCH] PIC support for SH


On Aug 29, 2000, kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:

> 	* gcc/config/sh/elf.h: Add -pic option to the assembler in -fpic
> 	case.

What was the rationale for requiring a `-pic' option in the assembler?
In our internal implementation, derived from ours, we didn't keep this
flag.

> 	(print_operand): Add a modifier code $ to print REGISTER_PREFIX.

What's the point of using a register prefix?  It doesn't help at all,
even when you remove the underscore prefix from symbol names.  Using a
register prefix only makes sense to disambiguate them from symbol
names, but there's no need for this disambiguation in SH assembly code
generated by GCC.  Code generated by GCC never references global
symbols as immediates, since it must always go through the constant
pool.

As operands to regular instructions, we'd still parse a name that
matches a register name as a register, since the `$' prefix is
optional.  In the constant pool, registers don't make sense.  So, the
only case that requires disambiguation is when you want to refer to a
non-.L symbol as an immediate operand to an instruction.  Since the
`$' prefix is optional, this has to be done by prefixing the symbol
with `0+', so that the assembler understands the operand as an
expression, and parses the following name as a symbol, not as a
register.

Of course, we could support `$' prefixes, with a 4-line change in the
assembler, but I didn't think it was worth it.  It's probably better
to remove any uses of it from the (hopefully small) existing
code-base of hand-crafted assembly that uses this extension.

> 	(NEED_PLT_GOT): Defined.
> 	(GOT_PCREL): Likewize.

Any reason why you're defining these?  They don't seem to be used
anywhere.


I'll post the patches we have for PIC support on SH shortly.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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