<div dir="ltr">Does the behavior change if you declare "cont" as a global symbol?  Does the symbol have to be "cont"?  Would ".Lcont" suffice?  Many targets treat leading ".L" as implicitly local symbols.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 10, 2021 at 6:30 PM Alexander von Below via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks a lot for your answer, and yes, I do: <br>
<br>
Working code (using numeric label): <a href="https://github.com/below/HelloSilicon/blob/main/Chapter%2009/uppertst4.cNon-working" rel="noreferrer" target="_blank">https://github.com/below/HelloSilicon/blob/main/Chapter%2009/uppertst4.c<br>
Non-working</a> (original) code: <a href="https://github.com/below/HelloSilicon/blob/4c4b2911c43644adfd3b78aee093857444f28472/Chapter%209/uppertst4.c" rel="noreferrer" target="_blank">https://github.com/below/HelloSilicon/blob/4c4b2911c43644adfd3b78aee093857444f28472/Chapter%209/uppertst4.c</a><br>
<br>
Compile using the makefile in the same folder, or using "clang -o uppertst4 uppertst4.c“<br>
<br>
On godbolt, running the original code through  armv8-a-clang 11.0.1 or trunk, everything seems to work fine. There is an unrelated warning, but no errors. The output shows both the loop and the cont labels: <a href="https://godbolt.org/z/xY5afcYdW" rel="noreferrer" target="_blank">https://godbolt.org/z/xY5afcYdW</a><br>
<br>
Compiling the code with the symbolic cont label on an M1 using clang-1300.0.29.3 produces the errors:<br>
<br>
uppertst4.c:22:4: error: conditional branch requires assembler-local label. 'cont' is external.<br>
                "BGT    cont\n"<br>
                 ^<br>
<inline asm>:4:1: note: instantiated into assembly here<br>
BGT     cont<br>
^<br>
uppertst4.c:24:4: error: conditional branch requires assembler-local label. 'cont' is external.<br>
                "BLT    cont\n"<br>
                 ^<br>
<inline asm>:6:1: note: instantiated into assembly here<br>
BLT     cont<br>
^<br>
uppertst4.c:28:4: error: conditional branch requires assembler-local label. 'loop' is external.<br>
                "<a href="http://B.NE" rel="noreferrer" target="_blank">B.NE</a>   loop\n"<br>
                 ^<br>
<inline asm>:10:1: note: instantiated into assembly here<br>
<a href="http://B.NE" rel="noreferrer" target="_blank">B.NE</a>    loop<br>
^<br>
<br>
Notably, now for both loop and cont, while it is sufficient to replace cont with a numeric label.<br>
<br>
I would be glad to find out if I am doing it wrong, or if this is an issue in clang. And now my curiosity is raised why godbolt appears to differ from clang on macOS …<br>
<br>
Thanks again<br>
<br>
Alex<br>
<br>
<br>
> Am 11.10.2021 um 00:26 schrieb Joerg Sonnenberger via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>:<br>
> <br>
> On Sun, Oct 10, 2021 at 12:27:28PM +0200, Alexander von Below via cfe-dev wrote:<br>
>> I have tried to adapt gnu as code for Apple Silicon, and I have found<br>
>> explanations for most differences. There is one issue I still have:<br>
> <br>
> Do you actually have a complete self-contained example? Try <a href="http://godbolt.org" rel="noreferrer" target="_blank">godbolt.org</a>.<br>
> <br>
> Joerg<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">-Brian</div>