This is the mail archive of the
mailing list for the GCC project.
Re: The nvptx port [0/11+]
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 21 Oct 2014 12:56:10 +0200
- Subject: Re: The nvptx port [0/11+]
- Authentication-results: sourceware.org; auth=none
- References: <54451994 dot 9070209 at codesourcery dot com> <20141021084206 dot GV10376 at tucnak dot redhat dot com>
On 10/21/2014 10:42 AM, Jakub Jelinek wrote:
On Mon, Oct 20, 2014 at 04:17:56PM +0200, Bernd Schmidt wrote:
* Can't emit initializers referring to their variable's address since
you can't write forward declarations for variables.
Can't that be handled by emitting the initializer without the address and
some constructor that fixes up the initializer at runtime?
That reminds me that constructors are something I forgot to add to the
list. I'm thinking about making these work with some trickery in the
"linker", but at the moment they are unsupported.
Can't you represent structures and unions as arrays of chars?
For constant initializers that don't need relocations the compiler can
surely turn them into arrays of char initializers (e.g. fold-const.c
native_encode_expr/native_interpret_expr could be used for that).
Supposedly it would mean slower than perhaps necessary loads/stores of
aligned larger fields from the structure, but if it is an alternative to
not supporting structures/unions at all, that sounds like so severe
limitation that it can be pretty fatal for the target.
Oh, structs and unions are supported, and essentially that's what I'm
doing - I choose a base integer type to represent them. That happens to
be the size of a pointer, so properly aligned symbol refs can be
emitted. It's just the packed ones that can't be done.
* No support for indirect jumps, label values, nonlocal gotos.
Not even indirect calls? How do you implement C++ or Fortran vtables?
Indirect calls do exist.