not really but it would reduce the amount of UB exploitation. there's a long tail scattered around many passes that you can't find so easily, requires a fine-toothed comb.
-
-
Replying to @johnregehr @vyodaiken
Not sure that’s really true. WebKit’s LLVM-based FTL JIT encountered no such problems to my knowledge. High probability we would have known. We even ran tests with the full -O3 pipeline. Maybe there are bugs, but I wouldn’t conflate that with UB.
2 replies 0 retweets 0 likes -
To name one off the top of my head: You have to do something to sanitize float-to-int casts or else they become undefs if out of range. For a long time “array[x as usize]” with x: f64 could cause UB in safe Rust for this reason.
2 replies 1 retweet 6 likes -
There's also the perpetually annoying 'a function calling itself in an infinite loop is UB'
3 replies 0 retweets 4 likes -
I feel like y’all are listing things that can be fixed through the vigorous application of software engineering.
1 reply 0 retweets 1 like -
I think John's point is that there isn't a well defined list of these things for LLVM, so you end up having to shoot them as you find/are made aware of them.
4 replies 0 retweets 2 likes -
I bring up the recursive call thing because, yeah you can try to pattern-match and guard against that one in obvious cases, but it reaches Halting Problem territory when it can creep up through other optimizations
2 replies 0 retweets 4 likes -
That one is best fixed in llvm. (Context for this thread: my claim that it’s better to start with clang/llvm and refactor to make a no-UB compiler than to start from scratch.)
1 reply 0 retweets 1 like -
huuuge +1 to that
1 reply 0 retweets 0 likes -
Well, it depends on how much you want LLVM’s optimizations. Cranelift is mostly an alternative nowadays if you want reasonable code with fast compile speed.
3 replies 0 retweets 3 likes
It’s pretty much LLVM or GCC if you want really fast code though.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.