return after trap

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 06:57:28 PDT 2017



On 2017-06-09 15:45, Ulrich Weigand wrote:
>
> Jonas Paulsson <paulsson at linux.vnet.ibm.com> wrote on 09.06.2017 15:40:03:
>
> > At -O1 and higher these are both optimized to have the ret removed:
> >
> > *** IR Dump After Simplify the CFG ***
> > ; Function Attrs: nounwind
> > define void @test0() #0 {
> > entry:
> >   call void @llvm.trap()
> >   unreachable
> > }
> >
> > , so only at -O0 is there a ret remaining.
>
> So if we run the whole thing through clang at -O0 (with expensive
> checks), do we still get errors?
>
> Bye,
> Ulrich
>

Yes, with the terminator / barrier flags, it fails at -O0 ,but not at 
-O3 (function returning an int).

/Jonas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170609/86b02394/attachment.html>


More information about the llvm-commits mailing list