[llvm-bugs] [Bug 48369] New: opt crash with "-mem2reg -deadargelim -simplifycfg -inline -sroa -early-cse-memssa -jump-threading -instcombine" at "Combine redundant instructions"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 3 05:11:11 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48369

            Bug ID: 48369
           Summary: opt crash with "-mem2reg -deadargelim -simplifycfg
                    -inline -sroa -early-cse-memssa -jump-threading
                    -instcombine" at "Combine redundant instructions"
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: suochenyao at 163.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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

*******************************************************************************
OS and Platform:
CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
*******************************************************************************
Program:
$ cat a.c
short a=0;
int b=0, d=0, f=0;
long c=0;
char e=0;
int main() {
  int g = 3;
  for (; a;) {
    int h = 0;
    for (;; d) {
      c = (h <= 0) << 8;
      h = b;
      for (; g;)
        ;
      for (; f;)
        for (; e;)
          ;
    }
  }
  return 0;
}
*******************************************************************************
clang version:
$ clang --version
clang version 12.0.0 (/home/suocy/src/llvm-dev/llvm-project/llvm/tools/clang
e52a91e156d7ab26989fef526434b02514428c91)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/suocy/bin/llvm-dev/bin
*******************************************************************************
Command Lines:
$ clang -O3 -mllvm -disable-llvm-optzns -c -emit-llvm a.c -o a.bc
a.c:9:13: warning: expression result unused [-Wunused-value]
    for (;; d) {
            ^
1 warning generated.
$ opt -mem2reg -deadargelim -simplifycfg -inline -sroa -early-cse-memssa
-jump-threading -instcombine a.bc -o a.opt.bc
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /home/suocy/bin/llvm-dev/bin/opt -mem2reg
-deadargelim -simplifycfg -inline -sroa -early-cse-memssa -jump-threading
-instcombine a.bc -o a.opt.bc
1.      Running pass 'CallGraph Pass Manager' on module 'a.bc'.
2.      Running pass 'Combine redundant instructions' on function '@main'
 #0 0x0000000002a8136c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/suocy/bin/llvm-dev/bin/opt+0x2a8136c)
 #1 0x0000000002a7f1e4 llvm::sys::RunSignalHandlers()
(/home/suocy/bin/llvm-dev/bin/opt+0x2a7f1e4)
 #2 0x0000000002a7f343 SignalHandler(int)
(/home/suocy/bin/llvm-dev/bin/opt+0x2a7f343)
 #3 0x00007fec2e9b4630 __restore_rt (/lib64/libpthread.so.0+0xf630)
 #4 0x0000000002584f5e
llvm::InstCombinerImpl::visitSelectInst(llvm::SelectInst&)
(/home/suocy/bin/llvm-dev/bin/opt+0x2584f5e)
 #5 0x00000000024f310a llvm::InstCombinerImpl::run()
(/home/suocy/bin/llvm-dev/bin/opt+0x24f310a)
 #6 0x00000000024f4d29 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&,
llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*,
llvm::ProfileSummaryInfo*, unsigned int, llvm::LoopInfo*)
(/home/suocy/bin/llvm-dev/bin/opt+0x24f4d29)
 #7 0x00000000024f698a
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)
(/home/suocy/bin/llvm-dev/bin/opt+0x24f698a)
 #8 0x00000000022bf598 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/suocy/bin/llvm-dev/bin/opt+0x22bf598)
 #9 0x0000000001a304f4 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/suocy/bin/llvm-dev/bin/opt+0x1a304f4)
#10 0x00000000022bee43 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/suocy/bin/llvm-dev/bin/opt+0x22bee43)
#11 0x000000000072c61b main (/home/suocy/bin/llvm-dev/bin/opt+0x72c61b)
#12 0x00007fec2d58e555 __libc_start_main (/lib64/libc.so.6+0x22555)
#13 0x00000000007ddac5 _start (/home/suocy/bin/llvm-dev/bin/opt+0x7ddac5)
Segmentation fault

-- 
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/20201203/6de4e4f9/attachment.html>


More information about the llvm-bugs mailing list