llvm / llvm-project

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

ARM does not support trampolines #4100

Open llvmbot opened 15 years ago

llvmbot commented 15 years ago
Bugzilla Link 3728
Version trunk
OS Linux
Attachments bugpoint-reduced-simplified.ll
Reporter LLVM Bugzilla Contributor

Extended Description

I encountered the following assertion during compilation using x86_64->arm cross compiler that I built. llvm rev no: 66050.

Please find bugpoint-reduced-simplified.ll attached.

Thanks.

llvmbot commented 15 years ago

still exists with llvm rev 81322

xerxes@overo:/usr/src/openembedded/verdexpro/tmp/work/armv5te-angstrom-linux-gnueabi/llvm2.6-2.5+svnr81322-r1/trunk/build/bin$ ./llvm-as < /home/xerxes/3728. ll | ./llc -march=arm .file "" .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 Don't know how to custom lower this! UNREACHABLE executed at /usr/src/openembedded/verdexpro/tmp/work/armv5te-angstrom-linux-gnueabi/llvm2.6-2.5+svnr81322-r1/trunk/lib/Target/ARM/ARMISelLowering.cpp:2788! Stack dump:

  1. Program arguments: ./llc -march=arm
  2. Running pass 'ARM Instruction Selection' on function '@RunTestInMode' Aborted
llvmbot commented 15 years ago

retesting with llvm svn rev 79847

xerxes@sheeva:/usr/src/build$ ./buildbot/llvm-arm-linux/build/Debug/bin/llvm-as < bugpoint-reduced-simplified.ll | ./buildbot/llvm-arm-linux/build/Debug/bin/llc -march=arm .file "" .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 Don't know how to custom lower this! UNREACHABLE executed at ARMISelLowering.cpp:2759! 0 llc 0x011a08b8 1 llc 0x011a1170 2 libc.so.6 0x4022bc10 __default_sa_restorer_v2 + 0 Stack dump:

  1. Program arguments: ./buildbot/llvm-arm-linux/build/Debug/bin/llc -march=arm
  2. Running pass 'ARM Instruction Selection' on function '@RunTestInMode' Aborted xerxes@sheeva:/usr/src/build$
llvmbot commented 15 years ago

The ouput of the testcase:

llvm-as < ./bugpoint-reduced-simplified.ll | llc -march=arm llc: /usr/src/openembedded/overo/tmp/work/armv7a-angstrom-linux-gnueabi/llvm2.6-2.5+svnr20090511-r0/trunk/lib/Target/ARM/ARMISelLowering.cpp:1596: virtual llvm::SDValue llvm::ARMTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&): Assertion `0 && "Don't know how to custom lower this!"' failed. Stack dump:

  1. Program arguments: llc -march=arm
  2. Running pass 'ARM Instruction Selection' on function '@RunTestInMode' Aborted
llvmbot commented 15 years ago

It shouldn't be too hard to add support for trampolines to ARM. The usual technique is to study the code sequence gcc uses and implement it or a variant in the LLVM code generators. If you are interested, compare the ppc and x86 cases in LLVM and gcc.

That said, not sure why pointers to nested functions are being used in the ARM llvm-gcc cross build... What is the original code?