<div dir="ltr"><div dir="ltr"><div dir="ltr">FWIW, clang 11.0 reproduces the bug: <a href="https://godbolt.org/z/GvoK63">https://godbolt.org/z/GvoK63</a></div><div>But clang trunk doesn't: <a href="https://godbolt.org/z/bed7eM">https://godbolt.org/z/bed7eM</a></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 18, 2021 at 10:01 AM Craig Topper via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">I ran the IR through clang -O2 on godbolt and didn't get a return. So I think something is happening in the middle end?<br clear="all"><div><div dir="ltr"><br></div><div dir="ltr">~Craig</div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 17, 2021 at 4:57 PM Johannes Doerfert <<a href="mailto:johannesdoerfert@gmail.com" target="_blank">johannesdoerfert@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">llc generates the return in all version I tried: <br>
<a href="https://godbolt.org/z/oh3fqh" rel="noreferrer" target="_blank">https://godbolt.org/z/oh3fqh</a><br>
<br>
<br>
On 2/17/21 6:46 PM, Craig Topper wrote:<br>
> What version of llvm are you using? Godbolt is showing trunk and llvm 10<br>
> have a conditional branch, llvm 11 does not.<br>
><br>
> ~Craig<br>
><br>
><br>
> On Wed, Feb 17, 2021 at 4:41 PM Richard Kenner via llvm-dev <<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
>>> Long story short, from what I can see there is no miscompilation<br>
>>> or change in semantics for that matter.<br>
>> So why does the .s file not contain the loop exit test?<br>
>><br>
>> .text<br>
>> .file "c26006a.adb"<br>
>> .globl _ada_c26006a # -- Begin function<br>
>> _ada_c26006a<br>
>> .p2align 4, 0x90<br>
>> .type _ada_c26006a,@function<br>
>> _ada_c26006a: # @_ada_c26006a<br>
>> .cfi_startproc<br>
>> # %bb.0: # %entry<br>
>> pushq %rbx<br>
>> .cfi_def_cfa_offset 16<br>
>> subq $32, %rsp<br>
>> .cfi_def_cfa_offset 48<br>
>> .cfi_offset %rbx, -16<br>
>> movw $8257, 16(%rsp) # imm = 0x2041<br>
>> movb $49, 18(%rsp)<br>
>> movw $8257, (%rsp) # imm = 0x2041<br>
>> movb $50, 2(%rsp)<br>
>> xorl %ebx, %ebx<br>
>> jmp .LBB0_1<br>
>> .p2align 4, 0x90<br>
>> .LBB0_3: # %loop.cond.iter<br>
>> # in Loop: Header=BB0_1 Depth=1<br>
>> incb %bl<br>
>> .LBB0_1: # %loop.cond<br>
>> # =>This Inner Loop Header: Depth=1<br>
>> movb %bl, 17(%rsp)<br>
>> movb %bl, 1(%rsp)<br>
>> movzwl (%rsp), %eax<br>
>> xorw 16(%rsp), %ax<br>
>> movzbl 2(%rsp), %ecx<br>
>> xorb 18(%rsp), %cl<br>
>> movzbl %cl, %ecx<br>
>> orw %ax, %cx<br>
>> jne .LBB0_3<br>
>> # %bb.2: # in Loop: Header=BB0_1 Depth=1<br>
>> callq abort<br>
>> jmp .LBB0_3<br>
>> .Lfunc_end0:<br>
>> .size _ada_c26006a, .Lfunc_end0-_ada_c26006a<br>
>> .cfi_endproc<br>
>> # -- End function<br>
>> .section ".note.GNU-stack","",@progbits<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>><br>
</blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br></div><font size="1">Juneyoung Lee</font><div><font size="1">Software Foundation Lab, Seoul National University</font></div></div></div>