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.


Bernd

Reply via email to