glynn@info.ucl.ac.be (Kevin Glynn) writes:
> Sure enough running conftest returns 1. I don't understand what it is
> doing, so if you can tell me how to debug it I would be pleased ...
Wait a little bit, I think I finally understood why gcc seemed to
generate the wrong code. It's very tricky. Contrary to what I
thought, it is not enough to have an if (init) { ... } section with
explicit jumps to the fake labels. The reason is that gcc is very
clever and takes into a account that those would be the _only_ ways to
reach these labels. We really have to take the addresses of the
labels and store them in a datastructure that is globally accessible.
I believe this is the only way to trick gcc into really believing that
these labels might escape (and thus be jumped to when executing a
threaded bytecode program).
I eventually realized this was the problem after staring in disbelief
at the assembly code for printf statements that I added and for which
the compiler clearly believed that the args to printed where all
zeros.
I am working on testing this new theory. I'll let you know how it
turns out.
Cheers,
-- Denys Duchier - Équipe Calligramme - LORIA, Nancy, France - Please send submissions to hackers@mozart-oz.org and administriva mail to hackers-request@mozart-oz.org. The Mozart Oz web site is at http://www.mozart-oz.org/.