Hi Igor,<br><br><div class="gmail_quote">On Thu, Dec 30, 2010 at 1:37 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
(warnings are supressed)<br>
<br>
In file included from<br>
/Users/sig/projects/cog/sig-cog/build/../platforms/Mac<br>
OS/vm/Developer/sqGnu.h:46,<br>
                 from /Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:20:<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c: At top level:<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c: At top level:<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:15490: note:<br>
‘theIP’ was declared here<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:34730: note:<br>
‘hdrTypeBits’ was declared here<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:14690: note:<br>
‘hdrTypeBits’ was declared here<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:35424: note:<br>
‘freeChunkSize’ was declared here<br>
/Users/sig/projects/cog/sig-cog/src/vm/gcc3x-interp.c:35311: note:<br>
‘freeChunkSize’ was declared here<br>
/var/folders/kE/kEXZB7BWHXWwxswd6aL4XU+++TM/-Tmp-//ccIxqx9C.s:143250:FATAL:Symbol<br>
L0bereaveAllMarriedContexts already defined.<br></blockquote><div><br></div><div>So two things here.  One is what these labels are.  The labels that are added by the code generator simply for performance measurement.  See the define of VM_LABEL in the various sqPlatformSpecific.h files.  So this is not necessary but essential if using the VMProfiler to profile the stack interpreter.  If a method is marked with an &lt;asmLabel: true&gt; pragma the code generator outputs a label for it and one can ten identify the particular code sequence (e.g. a bytecode) in the VMProfiler.</div>
<div><br></div><div>The other is what causes the error.  The C compiler can choose to inline code, but both gcc and icc appear not to examine the code they&#39;re inlining for inserted labels and end up duplicating the labels inserted by VM_LABEL.  Since this duplication depends on the exact source and compiler optimization level in force there&#39;s no easy way to predict when a label will be duplicated.  The fix is to add &lt;asmLabel: false&gt; to the relevant method.  A better fix might be to add a &lt;C: #noinline&gt; pragma that would result in turning off inlining for the relevant function (for example I don&#39;t think it appropriate at all that the C compiler is inlining bereaveAllMarriedContexts; it doesn&#39;t happen all that often - basically at snapshot or voiding machien code - and inlining it is a silly decision on the C compiler&#39;s part).  A hack fix is of course to simply define VM_LABEL as 0, but that criples the VMProfiler.</div>
<div><br></div><div>HTH</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
i found the only use of it in generated code:<br>
<br>
voidVMStateForSnapshot(void) {<br>
DECL_MAYBE_SQ_GLOBAL_STRUCT<br>
    sqInt activeContext;<br>
    sqInt header;<br>
    sqInt oop;<br>
    sqInt sz;<br>
<br>
        activeContext = divorceAllFrames();<br>
        /* begin bereaveAllMarriedContexts */<br>
        VM_LABEL(0bereaveAllMarriedContexts);<br>
<br>
<br>
but gcc insists that there are another one???<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br>