[LLVMbugs] [Bug 21913] New: Infinite loop in llvm::MachineBlockFrequencyInfo::getBlockFreq

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 14 14:00:56 PST 2014


            Bug ID: 21913
           Summary: Infinite loop in
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: email at piotr-stefaniak.me
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I seem to have found a case where Clang (rev. 224219) gets stuck in
llvm::BranchProbability::scale(unsigned long) and/or
llvm::MachineBlockFrequencyInfo::getBlockFreq(llvm::MachineBasicBlock const*).

This is how I reproduce it:

pstef at gentoo /tmp $ git clone --depth 1 https://github.com/libtom/libtomcrypt
Cloning into 'libtomcrypt'...
remote: Counting objects: 546, done.
remote: Compressing objects: 100% (468/468), done.
remote: Total 546 (delta 155), reused 190 (delta 74)
Receiving objects: 100% (546/546), 2.64 MiB | 851.00 KiB/s, done.
Resolving deltas: 100% (155/155), done.
Checking connectivity... done.
pstef at gentoo /tmp $ cd libtomcrypt
pstef at gentoo /tmp/libtomcrypt $ clang -fsanitize=undefined -I./src/headers/ -O1
-c -o src/ciphers/safer/saferp.o src/ciphers/safer/saferp.c
pstef at gentoo /tmp/libtomcrypt $ \time clang -fsanitize=undefined
-I./src/headers/ -O1 -c -o src/ciphers/safer/saferp.o
^CCommand terminated by signal 2
0.00user 0.00system 8:17.20elapsed 0%CPU (0avgtext+0avgdata 52784maxresident)k
0inputs+0outputs (0major+330minor)pagefaults 0swaps
pstef at gentoo /tmp/libtomcrypt $ uname -a
Linux gentoo 3.16.5-gentoo #1 SMP Sun Nov 23 12:08:11 CET 2014 x86_64 Intel
Core 2 Duo P9xxx (Penryn Class Core 2) GenuineIntel GNU/Linux
pstef at gentoo /tmp/libtomcrypt $ clang --version
clang version 3.6.0 (trunk 224219)
Target: x86_64-unknown-linux-gnu
Thread model: posix

And this is the most relevant (slightly edited) part of PerfTop's output:

   PerfTop:    3856 irqs/sec  kernel: 0.4%  exact:  0.0% [4000Hz cpu-clock], 
(all, 1 CPU)
    36.76%  clang             [.] llvm::BranchProbability::scale(unsigned long)
    23.85%  clang             [.]
llvm::MachineBlockFrequencyInfo::getBlockFreq(llvm::MachineBasicBlock const*)
     9.37%  clang             [.]
const&) const
     1.52%  clang             [.] 0x000000000198ea5c                            
     1.20%  libc-2.19.so      [.] 0x000000000008b65b

As requested from nicholas, I'm adding the post-optimized llvm IR as an
attachment to this report. It's created with:

clang -fsanitize=undefined -I./src/headers/ -O1 -flto -c -o file.bc

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/20141214/dbae181e/attachment.html>

More information about the llvm-bugs mailing list