[cvs-nhc98] newtables.c question

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri Jul 2 04:25:30 EDT 2004


Sven Panne <Sven.Panne at aedion.de> writes:

> A short question regarding newtables.c: It looks like startBytes must
> immediately precede ints, same for startChars/chars. Is this really
> the case?

Yes.  It is so that negative indexing from ints[] will work.

> If yes, it's just wishful thinking: Any decent C compiler
> should remove startFoo or is at least free to move it around...  :-[

Well, the whole of nhc98's bytecode generation relies on exactly
the same technique to embed labels in the middle of static arrays.
If there is ever a C-compiler for which it fails, we will have to
revert to the -noansiC option for bytecode generation, which in effect
does the same trick only in assembler.  (The only disadvantage of
the latter is the need to support many different assembly formats.)
Of course, another option might be C-- ...

> Code generated by nhc98 segfaults most of the time (nhc98 HEAD, iX86
> gcc 3.3.3), and I'm currently having a look what might be the cause.

Ian Lynagh recently sent a fix for seg faults with nhc98 built with an
underlying gcc-3.3.3.  It involves making the evil mangler more evil
(i.e. post-processing the assembly output from gcc).  Grep for 'perl'
in script/nhc98.inst.  The configure script should selectively enable
that line if it detects gcc-3.3.

Regards,
    Malcolm


More information about the Cvs-nhc98 mailing list