[llvm-commits] [llvm] r48822 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/X86/X86ISelDAGToDAG.cpp lib/Target/X86/X86ISelLowering.cpp

Dan Gohman gohman at apple.com
Wed Apr 2 14:28:43 PDT 2008


On Mar 26, 2008, at 5:39 AM, Roman Levenstein wrote:
>
> +
> +  SmallSetVector<SDNode*, 16> Users;
>   while (!From->use_empty()) {
> -    // Process users until they are all gone.
> -    SDNode *U = *From->use_begin();
> -
> +    SDNode::use_iterator UI = From->use_begin();
> +    SDNode *U = UI->getUser();
> +
> +    // Remember that this node is about to morph.
> +    if (Users.count(U))
> +      continue;
> +    Users.insert(U);

Hi Roman,

This code that remembers users is causing the loop to
repeat infinitely in some cases. Actually, if Users.count(U)
is ever true, it gooes into an infinite loop because
nothing happens that will make From->use_list()
get closer to being empty.

You can reproduce this by unmerging revision 48994 and
running llc on the attached testcase. 48994 is otherwise
unrelated, but it happens to change the way this testcase
gets compiled such that the above bug doesn't get triggered.

Can you take a look at this?

Thanks,

Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hang.ll
Type: application/octet-stream
Size: 1619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080402/9a7a3673/attachment.obj>
-------------- next part --------------



More information about the llvm-commits mailing list