[llvm-bugs] [Bug 43222] New: [SimplifyCFG] produces incorrect callbr's

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 4 18:31:28 PDT 2019


            Bug ID: 43222
           Summary: [SimplifyCFG] produces incorrect callbr's
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: ndesaulniers at google.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    natechancellor at gmail.com, srhines at google.com
            Blocks: 4068

Created attachment 22471
  --> https://bugs.llvm.org/attachment.cgi?id=22471&action=edit

With the attached test case, and new verifier check from
(https://reviews.llvm.org/D67196) I observe a failure in SimplifyCFG:

$ opt --simplifycfg z.ll -o /dev/null
Indirect label missing from arglist.
  callbr void asm sideeffect "// XXX: ${0:l}", "X"(i8* blockaddress(@andy_test,
          to label %land.rhs.i [label %if.end]
in function andy_test
LLVM ERROR: Broken function found, compilation aborted!

the indirect label list `[label %if.end]`.

Attaching z2.ll, which is the post-simplyifycfg-ed version that violates the

Looks like a simple phi is being replaced:

branch_test.exit:                                 ; preds = %entry, %land.rhs.i
  %0 = phi i1 [ true, %entry ], [ false, %land.rhs.i ]
  br i1 %0, label %if.end, label %if.then

where the blockaddress of %if.then is being updated correctly, but the indirect
label list is not.

Referenced Bugs:

[Bug 4068] [Meta] Compiling the Linux kernel with clang
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190905/81af9041/attachment.html>

More information about the llvm-bugs mailing list