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

llc aborts for simple hello world (blink an led) msp430 code #7058

Closed llvmbot closed 14 years ago

llvmbot commented 14 years ago
Bugzilla Link 6686
Resolution WORKSFORME
Resolved on Mar 23, 2010 14:43
Version 2.6
OS Linux
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

llvm and clang are svnned from release 26 revision 99316

llvm: URL: http://llvm.org/svn/llvm-project/llvm/branches/release_26 Repository Root: http://llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 99316 Node Kind: directory Schedule: normal Last Changed Author: tbrethou Last Changed Rev: 84985 Last Changed Date: 2009-10-23 21:52:47 -0400 (Fri, 23 Oct 2009)

llvm/tools/clang: URL: http://llvm.org/svn/llvm-project/cfe/branches/release_26 Repository Root: http://llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 99316 Node Kind: directory Schedule: normal Last Changed Author: tbrethou Last Changed Rev: 82195 Last Changed Date: 2009-09-18 01:10:35 -0400 (Fri, 18 Sep 2009)

define DCOCTL ((volatile unsigned char )0x0056)

define BCSCTL1 ((volatile unsigned char )0x0057)

define WDTCTL ((volatile unsigned char )0x0120)

define P1OUT ((volatile unsigned char )0x0021)

define P1DIR ((volatile unsigned char )0x0022)

define CALDCO_16MHZ ((volatile unsigned char )0x10F8)

define CALDCO_12MHZ ((volatile unsigned char )0x10FA)

define CALDCO_8MHZ ((volatile unsigned char )0x10FC)

define CALDCO_1MHZ ((volatile unsigned char )0x10FE)

define CALBC1_16MHZ ((volatile unsigned char )0x10F9)

define CALBC1_12MHZ ((volatile unsigned char )0x10FB)

define CALBC1_8MHZ ((volatile unsigned char )0x10FD)

define CALBC1_1MHZ ((volatile unsigned char )0x10FF)

extern unsigned char GET8 ( unsigned short ); extern void PUT8 ( unsigned short, unsigned char ); extern void PINGRET ( void );

void notmain ( void ) { unsigned short ra;

unsigned char ca,cb;
//use calibrated clock values
//PUT8(BCSCTL1,GET8(CALBC1_8MHZ));
//PUT8(DCOCTL,GET8(CALDCO_8MHZ));
BCSCTL1=CALBC1_16MHZ;
DCOCTL=CALDCO_16MHZ;

P1DIR=P1DIR|1;
ca=P1OUT;
cb=ca^1;
while(1)
{
    P1OUT=ca;
    ra=0xF000; while(--ra) PINGRET();
    P1OUT=cb;
    ra=0xF000; while(--ra) PINGRET();
}

}

clang -Wall -emit-llvm -c lltest.c -o lltestmain.bc

opt -std-compile-opts lltestmain.bc -f -o=lltestopt.bc

llc -march=msp430 lltestopt.bc -f -o=lltest.s

llc: ScheduleDAGSDNodesEmit.cpp:506: void llvm::ScheduleDAGSDNodes::EmitNode(llvm::SDNode, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo, llvm::DenseMapInfo >&): Assertion `(II.getNumOperands() == NumMIOperands || HasPhysRegOuts || II.isVariadic()) && "#operands for dag node doesn't match .td file!"' failed. 0 llc 0x0000000000a5d8ef 1 llc 0x0000000000a5f59d 2 libpthread.so.0 0x00007ffdb566c190 3 libc.so.6 0x00007ffdb49724b5 gsignal + 53 4 libc.so.6 0x00007ffdb4975f50 abort + 384 5 libc.so.6 0x00007ffdb496b481 __assert_fail + 241 6 llc 0x000000000067e391 llvm::ScheduleDAGSDNodes::EmitNode(llvm::SDNode, bool, bool, llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo, llvm::DenseMapInfo >&) + 977 7 llc 0x000000000067ed22 llvm::ScheduleDAGSDNodes::EmitSchedule() + 338 8 llc 0x00000000006eb9a2 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 2018 9 llc 0x00000000006ec180 llvm::SelectionDAGISel::SelectBasicBlock(llvm::BasicBlock, llvm::ilist_iterator, llvm::ilist_iterator) + 96 10 llc 0x00000000006eda13 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function&, llvm::MachineFunction&, llvm::MachineModuleInfo, llvm::DwarfWriter*, llvm::TargetInstrInfo const&) + 707 11 llc 0x00000000006eea20 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1024 12 llc 0x00000000009f2b1e llvm::FPPassManager::runOnFunction(llvm::Function&) + 574 13 llc 0x00000000009f2d3b llvm::FunctionPassManagerImpl::run(llvm::Function&) + 171 14 llc 0x00000000009f2fa1 llvm::FunctionPassManager::run(llvm::Function&) + 81 15 llc 0x00000000004f3faf main + 5407 16 libc.so.6 0x00007ffdb495dabd __libc_start_main + 253 17 llc 0x00000000004f1e69 Stack dump:

  1. Program arguments: llc -march=msp430 lltestopt.bc -f -o=lltest.s
  2. Running pass 'MSP430 DAG->DAG Pattern Instruction Selection' on function '@notmain' Aborted
asl commented 14 years ago

msp430 backend in 2.6 was of experimental quality. Consider using ToT - this bug was fixed long ago there.