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

assertion compiling debug code for ppc/linux #1610

Closed
nlewycky opened this issue Mar 3, 2007 · 4 comments
Closed

assertion compiling debug code for ppc/linux #1610

nlewycky opened this issue Mar 3, 2007 · 4 comments
Assignees
Labels
backend:PowerPC bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@nlewycky
Copy link
Contributor

nlewycky commented Mar 3, 2007

Bugzilla Link 1238
Resolution FIXED
Resolved on Feb 22, 2010 12:43
Version trunk
OS Linux
Attachments testcase

Extended Description

I encountered an assertion in when compiling llvm-gcc:

$ llc -mtriple=powerpc-gnu-linux bugpoint-reduced-simplified.bc
llc: LegalizeDAG.cpp:833:
llvm::SDOperand::SelectionDAGLegalize::LegalizeOp(llvm::SDOperand):
Assertion `0 && "This action is not supported yet!"' failed.
llvm/Debug/bin/llc((anonymous namespace)::PrintStackTrace()+0x1a)[0x886b354]
llvm/Debug/bin/llc((anonymous namespace)::SignalHandler(int)+0x110)[0x886b618]
[0xffffe500]
Aborted

@nlewycky
Copy link
Contributor Author

nlewycky commented Mar 3, 2007

assigned to @lattner

@nlewycky
Copy link
Contributor Author

nlewycky commented Mar 3, 2007

The C source for this example is:

int main() { return 0; }

you just have to compile with -g to see the crash.

@nlewycky
Copy link
Contributor Author

nlewycky commented Mar 3, 2007

Here's a backtrace (different line numbers show that this tree is closer to
current CVS):

(gdb) bt
#​0 0xffffe405 in __kernel_vsyscall ()
#​1 0xf7d2f811 in raise () from /lib/tls/i686/cmov/libc.so.6
#​2 0xf7d30fb9 in abort () from /lib/tls/i686/cmov/libc.so.6
#​3 0xf7d28fbf in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#​4 0x08650883 in (anonymous namespace)::SelectionDAGLegalize::LegalizeOp (
this=0xffc7277c, Op={Val = 0x899c298, ResNo = 0}) at LegalizeDAG.cpp:876
#​5 0x08671be2 in (anonymous namespace)::SelectionDAGLegalize::HandleOp (
this=0xffc7277c, Op={Val = 0x899c298, ResNo = 0}) at LegalizeDAG.cpp:475
#​6 0x08671fdc in (anonymous namespace)::SelectionDAGLegalize::LegalizeDAG (
this=0xffc7277c) at LegalizeDAG.cpp:355
#​7 0x0867212d in llvm::SelectionDAG::Legalize (this=0xffc72934)
at LegalizeDAG.cpp:5639
#​8 0x0860ea1b in llvm::SelectionDAGISel::CodeGenAndEmitDAG (this=0x89a6798,
DAG=@0xffc72934) at SelectionDAGISel.cpp:4373
#​9 0x086221e1 in llvm::SelectionDAGISel::SelectBasicBlock (this=0x89a6798,
LLVMBB=0x89a4458, MF=@0x899cf70, FuncInfo=@0xffc72a98)
at SelectionDAGISel.cpp:4403
#​10 0x086237dd in llvm::SelectionDAGISel::runOnFunction (this=0x89a6798,
Fn=@0x899d390) at SelectionDAGISel.cpp:4088
#​11 0x084aa937 in (anonymous namespace)::PPCDAGToDAGISel::runOnFunction (
this=0x89a6798, Fn=@0x899d390) at PPCISelDAGToDAG.cpp:54
#​12 0x08806bc4 in llvm::FPPassManager::runOnFunction (this=0x8999478,
F=@0x899d390) at PassManager.cpp:991

The code in question is this:

case ISD::LABEL:
assert(Node->getNumOperands() == 2 && "Invalid LABEL node!");
switch (TLI.getOperationAction(ISD::LABEL, MVT::Other)) {
default: assert(0 && "This action is not supported yet!");
case TargetLowering::Legal:
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the label id.
Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2);
break;
}
break;

gdb won't accept an expression with "ISD::LABEL" so I don't know what value it's
switching on.

@lattner
Copy link
Collaborator

lattner commented Mar 3, 2007

Fixed, patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070226/045464.html

However, you may now get undefined label errors when assembling the resultant .s file. If so, go into
PPCISelLowering.cpp, and delete this:

if (!TM.getSubtarget().isDarwin()) {
setOperationAction(ISD::LABEL, MVT::Other, Expand);

-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
backend:PowerPC bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

2 participants