[LLVMbugs] [Bug 22761] New: AARCH64 asm("b %0":: "i" (&someFunc)) broken

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 2 14:44:35 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22761

            Bug ID: 22761
           Summary: AARCH64 asm("b %0":: "i" (&someFunc)) broken
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: axelheider at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang from LLVM release 3.5 and 3.6 crash for

   asm("b %0":: s"i" (&someFunc))

when targeting AARCH64. It works find for AARCH32.

A minimal example is:

//------------------------------------------------------------------------------
__noreturn static void someFunc(void) { ... }
__naked __noreturn void entry64(void) { asm("b %0":: "i" (&someFunc)); }
//------------------------------------------------------------------------------

The error is this:

0  clang           0x0000000002442fd8 llvm::sys::PrintStackTrace(_IO_FILE*) +
40
1  clang           0x000000000244441b
2  libpthread.so.0 0x00002acc467be340
3  clang           0x000000000197ac8f
llvm::AArch64InstPrinter::getRegisterName(unsigned int, unsigned int) + 63
4  clang           0x00000000018c1b17
5  clang           0x0000000001e19488
llvm::AsmPrinter::EmitInlineAsm(llvm::MachineInstr const*) const + 2984
6  clang           0x0000000001e0f950 llvm::AsmPrinter::EmitFunctionBody() +
1344
7  clang           0x00000000018bfd72
8  clang           0x0000000001ec7093
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 99
9  clang           0x00000000023dc3a7
llvm::FPPassManager::runOnFunction(llvm::Function&) + 311
10 clang           0x00000000023dc57b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
11 clang           0x00000000023dc98a
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 794
12 clang           0x00000000008f004d
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
7773
13 clang           0x00000000008e5efb
14 clang           0x0000000000a69c83 clang::ParseAST(clang::Sema&, bool, bool)
+ 483
15 clang           0x0000000000716829 clang::FrontendAction::Execute() + 57
16 clang           0x00000000006eb5b3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 803
17 clang           0x00000000006d1a0b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2795
18 clang           0x00000000006c972e cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 702
19 clang           0x00000000006d0732 main + 11506
20 libc.so.6       0x00002acc47411ec5 __libc_start_main + 245
21 clang           0x00000000006c93a1
Stack dump:
0.    Program arguments: LLVM-V3.6/bin/clang -cc1 -triple aarch64-arm-none-eabi
-emit-obj -disable-free -disable-llvm-verifier -main-file-name test.c
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic
-target-feature +neon -target-abi aapcs -target-linker-version 2.24 -g
-dwarf-column-info -ffunction-sections -fdata-sections -coverage-file test.c.o
-resource-dir /test/LLVM-V3.6/bin/../lib/clang/3.6.0 -I /test/inc -O3 -Werror
-Wmissing-include-dirs -std=gnu11 -fdebug-compilation-dir /test -ferror-limit
19 -fmessage-length 159 -ffreestanding -mstackrealign
-fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o test.c.o -x c
test.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'test.c'.
4.    Running pass 'AArch64 Assembly Printer' on function '@someFunc'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 (tags/RELEASE_360/final)
Target: aarch64-arm-none-eabi
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150302/3b6ec127/attachment.html>


More information about the llvm-bugs mailing list