Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break-crit-edges incorrectly updates idoms for unreachable code #1482

Closed
nlewycky opened this issue Jan 14, 2007 · 9 comments
Closed

break-crit-edges incorrectly updates idoms for unreachable code #1482

nlewycky opened this issue Jan 14, 2007 · 9 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@nlewycky
Copy link
Contributor

Bugzilla Link 1110
Resolution FIXED
Resolved on Nov 07, 2018 00:17
Version 1.0
OS All
Attachments testcase
CC @asl

Extended Description

Steps to reproduce:

$ llvm/Debug/bin/opt -etforest -break-crit-edges -domtree x.bc -disable-output
Segmentation fault

The backtrace shows an infinite loop
#​123147 0x085b20b7 in llvm::DominatorTree::getNodeForBlock (this=0x87191f8,
BB=0x0) at Dominators.cpp:380

but before that, it seems that llvm::DominatorTree::calculate's "ImmDom", which
is gets from ImmediateDominator is out of date:

#​174577 0x085b225f in llvm::DominatorTree::calculate (this=0x87191f8,
ID=@0x871a1a8) at Dominators.cpp:399
399 Node *IDomNode = getNodeForBlock(ImmDom);
(gdb) p ImmDom
$2 = (class llvm::BasicBlock *) 0x8719838
(gdb) p ImmDom->getName()
Cannot access memory at address 0xff75effc
(gdb) down
#​174576 0x085b20b7 in llvm::DominatorTree::getNodeForBlock (this=0x87191f8,
BB=0x8719838) at Dominators.cpp:380
380 Node *IDomNode = getNodeForBlock(IDom);
(gdb) p IDom
$3 = (class llvm::BasicBlock *) 0x0

and that's the start of the infinite loop.

@nlewycky
Copy link
Contributor Author

assigned to @lattner

@nlewycky
Copy link
Contributor Author

Actually, "-idom -break-crit-edges -domtree" is sufficient.

@nlewycky
Copy link
Contributor Author

testcase in asm form

@asl
Copy link
Collaborator

asl commented Jan 14, 2007

segfault confirmed with TOT. Upgraded bytecode attached.

@asl
Copy link
Collaborator

asl commented Jan 14, 2007

Updated bytecode

@asl
Copy link
Collaborator

asl commented Jan 14, 2007

Updated source

@lattner
Copy link
Collaborator

lattner commented Jan 14, 2007

It sounds like b-c-e isn't updating idom correctly. I'll take a look.

@lattner
Copy link
Collaborator

lattner commented Jan 14, 2007

Fixed, testcase here: Analysis/Dominators/2007-01-14-BreakCritEdges.ll

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070108/042657.html

-Chris

@nlewycky
Copy link
Contributor Author

Yup, all better. Thanks Chris!

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

3 participants