Note: This release is what 1.1.0-beta4 should have been and gets rid of a LTO linker plugin issue (#1897, #1901) and a vtable-related regression (#1906). Some ABI fixes (PPC64) also made it into beta 6, see below.
(Changes from 1.1.0-beta3 release are marked with (new) and gone.)
Big news
- Frontend, druntime and Phobos are at version 2.071.2.
- Link-Time Optimization (LTO) with
-flto={thin|full}
(LLVM ≥ 3.9). LTO requires linker support and is therefore currently only supported on Linux (ld.gold
with LLVM plugin) and OS X. For more details, please refer to LLVM's and Clang's documentation, for example Clang's ThinLTO documentation. (#1840) (new) - Windows: enable C-style DLL exports/imports via
export
(functions only) (#1856) (new) - Experimental cross-module inlining (#1577, enable with
-enable-cross-module-inlining
) - Profile-guided optimization (PGO) (#1219)
- Experimental IR-to-obj caching with
-ir2obj-cache=<cache dir>
-cache=<cache dir>
(#1572, #1753, #1812, #1893) - Accept bitcode files on commandline (#1539)
@ldc.attributes.fastmath
for aggressive math optimization (#1472, #1438)- Binary distribution now bundles DUB (v1.1.1) (#1573)
- Breaking changes to command-line semantics (see http://forum.dlang.org/post/ubobkfmsspbsmjunosna@forum.dlang.org).
New features
- New traits
__traits(targetCPU)
and__traits(targetHasFeature, )
(#1434) - Drastic reduction of large symbol name lengths with optional
-hash-threshold
(#1445) @ldc.attributes.optStrategy(...)
for per-function optimization setting (#1637)- Extend intrinsic
llvm_memory_fence
for single-thread fences (#1837) (new) - Add function instrumentation and profiling options via
-finstrument-functions
(#1845) (new) - Add line-tables-only debuginfo via
-gline-tables-only
(#1861) (new) - Implement DMD-compatible
-betterC
(#1872) (new)
Platform support
- Supports LLVM 3.5 - 3.9 and current trunk (4.0).
- ABI fixes, mainly for PowerPC targets. For bootstrapping, make sure to use source branch
ltsmaster
or the latest 0.17.x release, as all existing LDC releases ≥ 1.0 for PowerPC are unusable. (#1905) (new) - Added ARM assembly code for Phobos
std.bigint
. (ldc-developers/phobos#31) - Added some definitions for OpenBSD. (ldc-developers/druntime@1ef8322)
- Updates for Solaris (ldc-developers/druntime#71, ldc-developers/druntime#72, ldc-developers/druntime#73, ldc-developers/druntime#74, ldc-developers/druntime#75, ldc-developers/druntime#79)
- Linux: changed default to fully relocatable, position independent code (PIC). Change back to non-relocatable with
-relocation-model=static
. (#1664)
Bug fixes
- Misc. DUB regressions introduced by beta 3 (#1819) (new)
- Don't output static libs (with relative target filename) in
-od
objects directory (for LDC, but continue to do so for LDMD, for DMD compatibility). - LDMD: avoid object file collisions (due to multiple D source files with identical name in different dirs) when creating a static lib and remove the object files on success, mimicking DMD.
- Create output directories recursively.
- Don't output static libs (with relative target filename) in
- Potential ICE when building vibe.d projects (#1741) (new)
- ICE when calling an abstract function. (#1822) (new)
- ICE for invalid
__asm
constraints. (#802) (new) - Wrong code for LLVM inline assembly returning a tuple (
__asmtuple
). (#1823) (new) - Potential ICE wrt. captured variables. (#1864) (new)
- ARM: ICE when using LTO. (#1860) (new)
- Union layout and initialization, fixing the compilation of DMD (#1846, fixing most cases of #1829) (new)
- Allow custom file extension for .ll/.bc./.s output files. (#1843) (new)
- Windows: produced binaries with debuginfos are now large-address-aware too. (#442, #1876) (new)
- Fix debuginfos for parameters. (#1816) (new)
- Allow alignment of global variables < pointer size. (#1825) (new)
- Promote more immutable array literals to LLVM constants. (#506, #1821, #1838) (new)
- ICE when incrementing a complex variable. (#1806)
llvm.va_start
not matched withllvm.va_end
(#1744)- ldmd2 ignores -od option for libraries. (#1724)
- ICE: toConstElem(CastExp) doesn't support NewExp as cast source. (#1723)
- Mark runtime intrinsic shims as pragma(inline, true). (#1715)
- pragma(inline, false) is incompatible with store/loadUnaligned. (#1711)
- ICE: function not fully analyzed; previous unreported errors compiling std.variant.VariantN!(16LU, int, string).VariantN.__xopEquals? (#1698)
- Segfault at at ldc/ldc-1.1.0/driver/main.cpp:1351. (#1696)
- Make sure MSVC Build Tools are automatically detected by LDC. (#1690)
- Update Windows README.txt. (#1689)
- [ldc2-1.1.0-beta2] Missing symbol with inlining enabled. (#1678)
- [REG ldc-1.1.0-beta2] ICE with templated classes. (#1677)
- FreeBSD: Fix shared library build, working Hello World. (#1673)
- Strange compile time error. (#1638)
- LDC+DUB on Windows: folder separator is ignored. (#1621)
- Fix evaluation order issues. (#1620, #1623)
- Ubuntu 16.10 linker failures due to PIE by default (relocation R_X86_64_32S … can not be used). (#1618)
- ICE on returning struct with zero-length static array. (#1611)
- Debug info generation fixes for LLVM >= 3.8. (#1598)
- ICE after return in the middle of a function on Win64/MSVC. (#1582)
- Enums with referenced struct members result in floating point error. (#1581)
pragma(inline, {true|false})
is no longer ignored (#1577)- Static array initialization with single element misdetected as direct construction via sret. (#1548)
- ICE on static typeid. (#1540)
- super doesn't work. (#1450)
- Sub-expression evaluation order fixes. (#1327)
- Add suffix to LTO linker plugin name to disambiguate with LLVM installation. (#1898) (new)
Building LDC
- LDC now requires a preinstalled D compiler. (Versions
0.17.*
and theltsmaster
branch can be used to 'bootstrap' a build when only a C++ compiler is available.) - On Unix-like systems we now use gcc for linking. (#1594)
Internals
- optimizer: Skip adding verifier function pass if
-disable-verify
is given. (#1591) - DValue refactoring. (#1562)
- Several improvements to generated IR. (#1528, #1630)
- The vtable's of inherited interfaces are now put between the class's _monitor field and the user data fields. (https://issues.dlang.org/show_bug.cgi?id=15644)
Known issues
- LDC does not zero the padding area of a
real
variable. This may lead to wrong results if the padding area is also considered. See #770. Does not apply toreal
members inside structs etc. - Phobos does not compile on MinGW platform.