[llvm-bugs] [Bug 32734] New: Infinite loop in "Globals Alias Analysis"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 21 06:35:38 PDT 2017


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

            Bug ID: 32734
           Summary: Infinite loop in "Globals Alias Analysis"
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

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

With

opt -S -o - tr13473.ll -indvars -barrier -globals-aa

"Globals Alias Analysis" seems to hang indefinitely.

Last printout with -debug-pass=Executions -debug is

[2017-04-21 15:06:47.800865164] 0x4b34620   Executing Pass 'CallGraph
Construction' on Module 'tr13473.ll'...
[2017-04-21 15:06:47.800936544] 0x4b34620   Executing Pass 'Globals Alias
Analysis' on Module 'tr13473.ll'...

If I stop in the debugger after letting it run for a while I get

#0  0x0000000000f77ac7 in llvm::isa_impl_wrap<llvm::GlobalValue, llvm::Constant
const* const, llvm::Constant const*>::doit (Val=@0x7fffffffb878: 0x5a90d98) at
../include/llvm/Support/Casting.h:121
#1  0x0000000000f77a15 in llvm::isa<llvm::GlobalValue, llvm::Constant const*>
(Val=@0x7fffffffb878: 0x5a90d98) at ../include/llvm/Support/Casting.h:141
#2  0x0000000002854eea in llvm::Constant::isConstantUsed (this=0x5a90cc8) at
../lib/IR/Constants.cpp:406
#3  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a90c50) at
../lib/IR/Constants.cpp:409
#4  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a90bf8) at
../lib/IR/Constants.cpp:409
#5  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a90b28) at
../lib/IR/Constants.cpp:409
#6  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a90a58) at
../lib/IR/Constants.cpp:409
#7  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93488) at
../lib/IR/Constants.cpp:409
#8  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93410) at
../lib/IR/Constants.cpp:409
#9  0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a933b8) at
../lib/IR/Constants.cpp:409
#10 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93340) at
../lib/IR/Constants.cpp:409
#11 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a932e8) at
../lib/IR/Constants.cpp:409
#12 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93218) at
../lib/IR/Constants.cpp:409
#13 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93148) at
../lib/IR/Constants.cpp:409
#14 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a93078) at
../lib/IR/Constants.cpp:409
#15 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92fa8) at
../lib/IR/Constants.cpp:409
#16 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92ed8) at
../lib/IR/Constants.cpp:409
#17 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92e60) at
../lib/IR/Constants.cpp:409
#18 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92e08) at
../lib/IR/Constants.cpp:409
#19 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92d90) at
../lib/IR/Constants.cpp:409
#20 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92d38) at
../lib/IR/Constants.cpp:409
#21 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92c68) at
../lib/IR/Constants.cpp:409
#22 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92b98) at
../lib/IR/Constants.cpp:409
#23 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92b20) at
../lib/IR/Constants.cpp:409
#24 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92ac8) at
../lib/IR/Constants.cpp:409
#25 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92a50) at
../lib/IR/Constants.cpp:409
#26 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a929f8) at
../lib/IR/Constants.cpp:409
#27 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92928) at
../lib/IR/Constants.cpp:409
#28 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92858) at
../lib/IR/Constants.cpp:409
#29 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92788) at
../lib/IR/Constants.cpp:409
#30 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92710) at
../lib/IR/Constants.cpp:409
#31 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a926b8) at
../lib/IR/Constants.cpp:409
#32 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92640) at
../lib/IR/Constants.cpp:409
#33 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a925e8) at
../lib/IR/Constants.cpp:409
#34 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92570) at
../lib/IR/Constants.cpp:409
#35 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a92518) at
../lib/IR/Constants.cpp:409
#36 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a290a8) at
../lib/IR/Constants.cpp:409
#37 0x0000000002127377 in llvm::GlobalsAAResult::AnalyzeUsesOfPointer
(this=0x5a8d990, V=0x5a26fd8, Readers=0x7fffffffc8f0, Writers=0x7fffffffc850,
OkayStoreDest=0x0) at ../lib/Analysis/GlobalsModRef.cpp:371
#38 0x0000000002126aca in llvm::GlobalsAAResult::AnalyzeGlobals
(this=0x5a8d990, M=...) at ../lib/Analysis/GlobalsModRef.cpp:288
#39 0x00000000021299c9 in llvm::GlobalsAAResult::analyzeModule (M=..., TLI=...,
CG=...) at ../lib/Analysis/GlobalsModRef.cpp:936
#40 0x0000000002129d81 in llvm::GlobalsAAWrapperPass::runOnModule
(this=0x5a56da0, M=...) at ../lib/Analysis/GlobalsModRef.cpp:969
#41 0x000000000297899e in (anonymous namespace)::MPPassManager::runOnModule
(this=0x5a26300, M=...) at ../lib/IR/LegacyPassManager.cpp:1601

A couple of "up" and print the C we first call isConstantUsed() on:

371           if (isa<GlobalValue>(C) || C->isConstantUsed())
(gdb) p C->dump()
i16 ptrtoint (i16* @f1.g to i16)

then down and print UC
(gdb) down
#36 0x0000000002854f09 in llvm::Constant::isConstantUsed (this=0x5a290a8) at
../lib/IR/Constants.cpp:409
409         if (UC->isConstantUsed())
(gdb) p UC->dump()
i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16
select (i1 icmp ult (i16 ptrtoint (i16* @f1.g to i16), i16 0), i16 0, i16
ptrtoint (i16* @f1.g to i16)), i16 ptrtoint (i16* @f1.g to i16)), i16 select
(i1 icmp ult (i16 ptrtoint (i16* @f1.g to i16), i16 0), i16 0, i16 ptrtoint
(i16* @f1.g to i16)), i16 ptrtoint (i16* @f1.g to i16)), i16 ptrtoint (i16*
@f1.g to i16)), i16 select (i1 icmp ugt (i16 select (i1 icmp ult (i16 ptrtoint
(i16* @f1.g to i16), i16 0), i16 0, i16 ptrtoint (i16* @f1.g to i16)), i16
ptrtoint (i16* @f1.g to i16)), i16 select (i1 icmp ult (i16 ptrtoint (i16*
@f1.g to i16), i16 0), i16 0, i16 ptrtoint (i16* @f1.g to i16)), i16 ptrtoint
(i16* @f1.g to i16)), i16 ptrtoint (i16* @f1.g to i16)), i16 ptrtoint (i16*
@f1.g to i16)), i16 select (i1 icmp ugt (i16 select (i1 icmp ugt (i16 select
(i1 icmp ult (i16 ptrtoint (i16* @f1.g to i16), i16 0), i16 0, i16 ptrtoint
(i16* @f1.g to i16)), i16 ptrtoint (i16* @f1.g to i16)), i16 select (i1 icmp
ult (i16 ptrtoint (i16* @f1.g to i16), i16 0), i16 0, i16 ptrtoint (i16* @f1.g
to i16)), i16 ptrtoint (i16* @f1.g to i16)), i16 ptrtoint (i16* @f1.g to i16)),
i16 select (i1 icmp u

and this goes on forever and ever.

-- 
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/20170421/b2744ea1/attachment.html>


More information about the llvm-bugs mailing list