llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

crash with -indvars #4787

Closed llvmbot closed 15 years ago

llvmbot commented 15 years ago
Bugzilla Link 4415
Resolution WORKSFORME
Resolved on Sep 01, 2009 13:39
Version trunk
OS MacOS X
Attachments Test case.
Reporter LLVM Bugzilla Contributor
CC @sunfishcode

Extended Description

The following testcase (run with opt -indvars bugpoint-reduced-simplified.bc) causes the following death in opt:

0 opt 0x004927f8 std::_Rb_tree<llvm::sys::Path, llvm::sys::Path, std::_Identity, std::less, std::allocator >::insert_unique(llvm::sys::Path const&) + 8504 1 opt 0x00492d7a std::_Rb_tree<llvm::sys::Path, llvm::sys::Path, std::_Identity, std::less, std::allocator >::insert_unique(llvm::sys::Path const&) + 9914 2 libSystem.B.dylib 0x970f62bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1760599407 4 opt 0x002c8f06 llvm::Pass llvm::callDefaultCtor<(anonymous namespace)::LoaderPass>() + 56950 5 opt 0x002c9489 llvm::Pass llvm::callDefaultCtor<(anonymous namespace)::LoaderPass>() + 58361 6 opt 0x002c971c llvm::Pass llvm::callDefaultCtor<(anonymous namespace)::LoaderPass>() + 59020 7 opt 0x000afc12 llvm::DenseMap<llvm::BasicBlock, llvm::Value, llvm::DenseMapInfo<llvm::BasicBlock>, llvm::DenseMapInfo<llvm::Value> >::find(llvm::BasicBlock const&) + 22114 8 opt 0x002a0c16 llvm::LoopInfo::print(std::ostream&, llvm::Module const) const + 4662 9 opt 0x00404139 llvm::FunctionPass::~FunctionPass() + 38825 10 opt 0x0040464d llvm::FunctionPass::~FunctionPass() + 40125 11 opt 0x00404d4e llvm::FunctionPass::~FunctionPass() + 41918 12 opt 0x00405224 llvm::FunctionPass::~FunctionPass() + 43156 13 opt 0x0040530b llvm::FunctionPass::~FunctionPass() + 43387 14 opt 0x00009d33 llvm::scc_iterator<llvm::CallGraphNode, llvm::GraphTraits<llvm::CallGraphNode> > llvm::scc_end<llvm::CallGraphNode>(llvm::CallGraphNode*) + 7251 15 opt 0x00002166 _mh_execute_header + 4454 Stack dump:

  1. Running pass 'Function Pass Manager' on module 'bugpoint-reduced-simplified.bc'.
  2. Running pass 'Loop Pass Manager' on function '@foo'
  3. Running pass 'Canonicalize Induction Variables' on basic block '%while.cond' Bus error
lattner commented 15 years ago

This apparently can't be reproduced.

sunfishcode commented 15 years ago

I'm not seeing the abort with this new testcase either.

Are you using a Release build? If so, does the problem show up in a Debug build? Do you have any local changes in your tree? Can you run opt under a debugger and capture a backtrace?

llvmbot commented 15 years ago

I'm not able to reproduce the problem with a very similar configuration.

After a clean rebuild I'm still getting exactly the same output. Here's an even more reduced testcase, if this helps:

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin9.0" %struct._bar = type <{ i32, i32 }>

define i64 @​foo(i32 %in.0, i32 %in.1) nounwind { entry: br label %while.cond

while.cond: ; preds = %while.body, %entry %in.01.1 = phi i32 [ %in.0, %entry ], [ %in.01.0, %while.body ] ; [#uses=6] %in.12.1 = phi i32 [ %in.1, %entry ], [ %in.12.0, %while.body ] ; [#uses=6] %cmp = icmp eq i32 %in.01.1, %in.12.1 ; [#uses=1] br i1 %cmp, label %while.end, label %while.body

while.body: ; preds = %while.cond %cmp10 = icmp sgt i32 %in.01.1, %in.12.1 ; [#uses=2] %sub = sub i32 %in.01.1, %in.12.1 ; [#uses=1] %sub19 = sub i32 %in.12.1, %in.01.1 ; [#uses=1] %in.01.0 = select i1 %cmp10, i32 %sub, i32 %in.01.1 ; [#uses=1] %in.12.0 = select i1 %cmp10, i32 %in.12.1, i32 %sub19 ; [#uses=1] br label %while.cond

while.end: ; preds = %while.cond %0 = zext i32 %in.01.1 to i64 ; [#uses=1] %1 = zext i32 %in.12.1 to i64 ; [#uses=1] %2 = shl i64 %1, 32 ; [#uses=1] %3 = or i64 %2, %0 ; [#uses=1] ret i64 %3 }

sunfishcode commented 15 years ago

I'm not able to reproduce the problem with a very similar configuration.

llvmbot commented 15 years ago

This doesn't fail for me on trunk. What version are you using?

r73779 (trunk).

Sorry, maybe specs might have been helpful: Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386

(Mac OS X 10.5.7 on a MacBook Pro)

llvmbot commented 15 years ago

This doesn't fail for me on trunk. What version are you using?

r73779 (trunk).

sunfishcode commented 15 years ago

This doesn't fail for me on trunk. What version are you using?