Comments (2)
Related LLVM change: https://reviews.llvm.org/D87123
from ldc.
This bug is not related to LLVM or wrong optimization by LLVM. The generated code does not even contain an icmp
because LDC recognizes that the condition is a compile-time constant and thus is known to be either true or false at compile-time and no branching is needed. (#3134, since 1.19)
The bug arises since 1.25, where for some reason "a" is "b"
evaluates to true
(when it is the condition of if
).
Edit: Actually this is related to LLVM. The bug shows up since LLVM 11.0.1, not with 11.0.0. LDC 1.25 happens to be released with LLVM 11.0.1, LDC 1.24 with LLVM 11.0.0.
Reproducer for change of LLVM behavior: https://llvm.godbolt.org/z/T4G9jcs1e
Notice how 11.0.0 folds the icmp
to false
, but 11.0.1 does not constfold the if-condition at all.
from ldc.
Related Issues (20)
- Implement CFI support
- WebAssembly Exceptions HOT 8
- LDC druntime calls private dyld API, which is not allowed by Apple. HOT 6
- perf: optimize indexing in inner loops HOT 2
- double-nested try/finally causes ICE on Windows (but not on Linux) HOT 5
- Time trace: large sections of std.stdio isn't showing up as what it is doing
- Re: Error: Instruction does not dominate all uses! HOT 4
- Print import paths HOT 3
- ldc ignore mtriple when use with --fsanitize=address HOT 1
- libLTO-ldc.dylib missing in 1.36 Release for osx-arm64 HOT 2
- DWARF for static members are wrong HOT 2
- ICE on `&(foo[])[0]`
- 'Instruction does not dominate all uses' wrt. ternary expressions using array literals HOT 1
- undefined reference to `llvm::SampleContextTracker::getContextString[abi:cxx11](llvm::sampleprof::FunctionSamples const&) const' HOT 2
- LDC-src Build: C++ ABI broken HOT 4
- linkonce-templates bugs HOT 2
- llvm 18 HOT 6
- Tests fail on Gentoo HOT 1
- ASan regression on Windows with MSVC 14.38.33130 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldc.