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]
Other format: [Raw text]

Re: The nvptx port [0/11+]


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?

	Jakub


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