[LLVMbugs] [Bug 17057] New: __builtin_readcyclecounter leads to ICE on ARMv6

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 2 08:48:24 PDT 2013


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

            Bug ID: 17057
           Summary: __builtin_readcyclecounter leads to ICE on ARMv6
           Product: new-bugs
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: schnetter at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I am using clang 3.3:

clang version 3.3 (branches/release_33 188901) (llvm/branches/release_33
188900)
Target: armv6-unknown-linux-gnueabihf
Thread model: posix

I am building this program:

pi at water ~/src/c $ cat builtin_cyclecounter.c 
unsigned long long f(void)
{
#if __has_builtin(__builtin_readcyclecounter)
  return __builtin_readcyclecounter();
#else
#  error "__builtin_readcyclecounter not available"
#endif
}

I am running on a Raspberry Pi:

pi at water ~/src/c $ uname -a
Linux water 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l GNU/Linux

I receive this error:

pi at water ~/src/c $ clang -S builtin_cyclecounter.c 
ExpandIntegerResult #0: 0x36cd948: i64,ch = ReadCycleCounter 0x36c05e4 [ORD=1]
[ID=0]

Do not know how to expand the result of this operator!
UNREACHABLE executed at
/home/pi/src/llvm-3.3/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1083!
Stack dump:
0.    Program arguments: /home/pi/llvm-3.3/bin/clang -cc1 -triple
armv6-unknown-linux-gnueabihf -S -disable-free -main-file-name
builtin_cyclecounter.c -mrelocation-model static -mdisable-fp-elim -fmath-errno
-mconstructor-aliases -fuse-init-array -target-abi aapcs-linux -target-cpu
arm1136jf-s -mfloat-abi hard -target-linker-version 2.22 -coverage-file
/home/pi/src/c/builtin_cyclecounter.s -resource-dir
/home/pi/llvm-3.3/bin/../lib/clang/3.3 -internal-isystem /usr/local/include
-internal-isystem /home/pi/llvm-3.3/bin/../lib/clang/3.3/include
-internal-externc-isystem /usr/include/arm-linux-gnueabihf
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fno-dwarf-directory-asm -fdebug-compilation-dir /home/pi/src/c -ferror-limit
19 -fmessage-length 80 -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -backend-option -vectorize-loops -o builtin_cyclecounter.s
-x c builtin_cyclecounter.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'builtin_cyclecounter.c'.
4.    Running pass 'ARM Instruction Selection' on function '@f'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (branches/release_33 188901) (llvm/branches/release_33
188900)
Target: armv6-unknown-linux-gnueabihf
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/builtin_cyclecounter-0fN6h0.c
clang: note: diagnostic msg: /tmp/builtin_cyclecounter-0fN6h0.sh
clang: note: diagnostic msg: 

********************

The requested files to attach are:

pi at water ~/src/c $ cat /tmp/builtin_cyclecounter-0fN6h0.c
# 1 "builtin_cyclecounter.c" 1
unsigned long long f(void)
{
#if __has_builtin(__builtin_readcyclecounter)
  return __builtin_readcyclecounter();
#else
#  error "__builtin_readcyclecounter not available"
#endif
}

pi at water ~/src/c $ cat /tmp/builtin_cyclecounter-0fN6h0.sh
/home/pi/llvm-3.3/bin/clang -cc1 -triple armv6-unknown-linux-gnueabihf -S
-disable-free -main-file-name builtin_cyclecounter.c -mrelocation-model static
-mdisable-fp-elim -fmath-errno -mconstructor-aliases -fuse-init-array
-target-abi aapcs-linux -target-cpu arm1136jf-s -mfloat-abi hard
-target-linker-version 2.22 -fno-dwarf-directory-asm -ferror-limit 19
-fmessage-length 80 -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -backend-option -vectorize-loops -x c
builtin_cyclecounter-0fN6h0.c

-- 
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/20130902/853d97e7/attachment.html>


More information about the llvm-bugs mailing list