Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1559698
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: llist code relies on undefined behaviour, upsets llvm/clang |
| Date | 2017-01-16 14:00 +0100 |
| Message-ID | <t0f3b-v1-1@gated-at.bofh.it> (permalink) |
| References | <t00GS-7DV-23@gated-at.bofh.it> <t0bsB-6yd-23@gated-at.bofh.it> <t0dXr-8gC-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jan 16, 2017 at 10:42:29PM +1100, Anton Blanchard wrote: > Hi Peter, > > > Last I checked I couldn't build a x86_64 kernel with llvm. So no, not > > something I've ever ran into. > > > > Also, I would argue that this is broken in llvm, the kernel very much > > relies on things like this all over the place. Sure, we're way outside > > of what the C language spec says, but who bloody cares ;-) > > True, but is there anything preventing gcc from implementing this > optimisation in the future? If we are relying on undefined behaviour we > should have a -fno-strict-* option to cover it. > > > If llvm wants to compile the kernel, it needs to learn the C dialect > > the kernel uses. > > LLVM has done that before (eg adding -fno-strict-overflow). I don't > think that option covers this case however. Our comment there states: # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) So this option should apply to pointer arithmetic, therefore I would expect -fno-strict-overflow to actually apply here, or am I missing something?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
llist code relies on undefined behaviour, upsets llvm/clang Anton Blanchard <anton@samba.org> - 2017-01-15 22:40 +0100
Re: llist code relies on undefined behaviour, upsets llvm/clang Peter Zijlstra <peterz@infradead.org> - 2017-01-16 10:10 +0100
Re: llist code relies on undefined behaviour, upsets llvm/clang Anton Blanchard <anton@samba.org> - 2017-01-16 12:50 +0100
Re: llist code relies on undefined behaviour, upsets llvm/clang Peter Zijlstra <peterz@infradead.org> - 2017-01-16 14:00 +0100
Re: llist code relies on undefined behaviour, upsets llvm/clang Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2017-01-16 14:10 +0100
RE: llist code relies on undefined behaviour, upsets llvm/clang David Laight <David.Laight@ACULAB.COM> - 2017-01-16 15:40 +0100
Re: llist code relies on undefined behaviour, upsets llvm/clang Peter Zijlstra <peterz@infradead.org> - 2017-01-16 17:30 +0100
csiph-web