This is the mail archive of the
mailing list for the GCC project.
Re: The nvptx port [0/11+]
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 21 Oct 2014 10:42:06 +0200
- Subject: Re: The nvptx port [0/11+]
- Authentication-results: sourceware.org; auth=none
- References: <54451994 dot 9070209 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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?
> * Variables can be declared only as scalars or arrays, not
> structures. Initializers must be in the variable's declared type,
> which requires some code in the backend, and it means that packed
> pointer values are not representable.
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.
> * No support for indirect jumps, label values, nonlocal gotos.
Not even indirect calls? How do you implement C++ or Fortran vtables?