[llvm-bugs] [Bug 43468] New: Hang when compiling massive switch with -Os

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 26 10:12:14 PDT 2019


            Bug ID: 43468
           Summary: Hang when compiling massive switch with -Os
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

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

The attached testcase is a machine-generated massive switch. When building with
-Os, it used to take around a minute (for comparison, similar to gcc). On
recent trunk, though (last day or so), it appears to hang forever, taking over
an hour before our CI gives up.

This is specific to -Os, as -O1 and others seem fine (takes a minute like


  clang -Os src.cpp

Trying to investigate this, I ran

  clang -Os src.cpp -mllvm -print-before-all 2>&1 | grep IR

The logging ends with

*** IR Dump Before Interleaved Access Pass ***
*** IR Dump Before Expand indirectbr instructions ***
*** IR Dump Before CodeGen Prepare ***
*** IR Dump Before Rewrite Symbols ***
*** IR Dump Before Exception handling preparation ***
*** IR Dump Before Safe Stack instrumentation pass ***
*** IR Dump Before Module Verifier ***

So it appears to hang in the Module Verifier?

Note that this testcase looks very artificial, but it is in our test suite
(emscripten) because a real-world user had similar code that in the past hit
some other bug, so we added this as a regression test.

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/20190926/6146ce70/attachment.html>

More information about the llvm-bugs mailing list