Thanks for using Compiler Explorer
D
CMake
d source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
aarch64-elf
aarch64-linux-gnu
aarch64-rtems
alpha-dec-vms
alpha-linux-gnu
alpha-netbsd
alpha-openbsd
alpha64-dec-vms
amdgcn-amdhsa
arc-linux-uclibc
arc600-elf32
arc700-elf32
arceb-linux-uclibc
arm-eabi
arm-linux-androideabi
arm-netbsdelf
arm-rtems
arm-symbianelf
arm-uclinux_eabi
arm-wrs-vxworks
avr-elf
bfin-elf
bfin-linux-uclibc
bfin-openbsd
bfin-rtems
bfin-uclinux
c6x-elf
c6x-uclinux
cr16-elf
cris-elf
cris-linux
crisv32-elf
crisv32-linux
csky-elf
csky-linux-gnu
epiphany-elf
epiphany-elf-stack-offset-16
fido-elf
fr30-elf
frv-elf
frv-linux
ft32-elf
h8300-elf
hppa-linux-gnu
hppa-linux-sjlj-excptions
hppa2.0-hpux10.1
hppa2.0-hpux11.9
hppa64-hpux11.0
hppa64-hpux11.3
hppa64-linux-gnu
i486-freebsd4
i686-apple-darwin
i686-apple-darwin10
i686-apple-darwin9
i686-cygwin
i686-elf
i686-freebsd6
i686-kfreebsd-gnu
i686-kopensolaris-gnu
i686-lynxos
i686-mingw32crt
i686-netbsdelf9
i686-nto-qnx
i686-openbsd
i686-pc-linux-gnu
i686-pc-msdosdjgpp
i686-rtems
i686-solaris2.11
i686-symbolics-gnu
i686-wrs-vxworks
i686-wrs-vxworksae
ia64-elf
ia64-freebsd6
ia64-hp-vms
ia64-hpux
ia64-linux
iq2000-elf
lm32-elf
lm32-rtems
lm32-uclinux
m32r-elf
m32r-linux
m32rle-elf
m32rle-linux
m68k-elf
m68k-linux
m68k-netbsdelf
m68k-openbsd
m68k-rtems
m68k-uclinux
mcore-elf
microblaze-elf
microblaze-linux
mips-netbsd
mips-rtems
mips-wrs-vxworks
mips64-elf
mips64el-st-linux-gnu
mips64octeon-linux
mips64orion-elf
mips64vr-elf
mipsel-elf
mipsisa32-elfoabi
mipsisa32r2-linux-gnu
mipsisa64-elfoabi
mipsisa64r2-linux
mipsisa64r2-sde-elf
mipsisa64r2el-elf
mipsisa64sb1-elf
mipsisa64sr71k-elf
mipstx39-elf
mmix-knuth-mmixware
mn10300-elf
moxie-elf
moxie-rtems
moxie-uclinux
msp430-elf
nds32be-elf
nds32le-elf
nios2-elf
nios2-linux-gnu
nios2-rtems
nvptx-none
pdp11-aout
powerpc-darwin7
powerpc-darwin8
powerpc-eabi
powerpc-eabialtivec
powerpc-eabisim
powerpc-eabisimaltivec
powerpc-freebsd6
powerpc-lynxos
powerpc-netbsd
powerpc-rtems
powerpc-wrs-vxworks
powerpc-wrs-vxworksae
powerpc-wrs-vxworksmils
powerpc-xilinx-eabi
powerpc64-darwin
powerpc64-linux_altivec
powerpcle-eabi
powerpcle-eabisim
powerpcle-elf
ppc-elf
riscv32-unknown-linux-gnu
riscv64-unknown-linux-gnu
rl78-elf
rs6000-ibm-aix6.1
rs6000-ibm-aix7.1
rx-elf
s390-linux-gnu
s390x-ibm-tpf
s390x-linux-gnu
sh-elf
sh-netbsdelf
sh-rtems
sh-superh-elf
sh-wrs-vxworks
shle-linux
sparc-elf
sparc-leon-elf
sparc-leon3-linux-gnu
sparc-linux-gnu
sparc-netbsdelf
sparc-rtems
sparc-wrs-vxworks
sparc64-elf
sparc64-freebsd6
sparc64-linux
sparc64-netbsd
sparc64-openbsd
sparc64-rtems
sparc64-sun-solaris2.11
v850-elf
v850-rtems
v850e-elf
vax-linux-gnu
vax-netbsdelf
visium-elf
x86_64-apple-darwin
x86_64-elf
x86_64-freebsd6
x86_64-mingw32
x86_64-netbsd
x86_64-pc-linux-gnu
x86_64-rtems
x86_64-w64-mingw32
xstormy16-elf
xtensa-elf
xtensa-linux
Options
Source code
// #1 pragma(inline, true) @trusted pure ref ix(El, Idx)(El[] arr, Idx idx) { version (none) { // Same as else branch import gcc.builtins : assert0 = __builtin_trap; if(idx >= arr.length) assert0; return arr.ptr[idx]; } else { return arr[idx]; } } auto getN(int[] arr, ushort n) { return arr.ix(n); } // #2 extern(C) @trusted void __vector_11() { asm { "reti"; } assume0(); } import gcc.builtins : assume0 = __builtin_unreachable;
Become a Patron
Sponsor on GitHub
Donate via PayPal
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
About the author
Statistics
Changelog
Version tree