search for: d32330

Displaying 2 results from an estimated 2 matches for "d32330".

2020 Jul 25
2
[cfe-dev] Zero length function pointer equality
...tuation - two functions described as being at the same address?) is there a quick summary of why those two cases turn out differently? On Fri, Jul 24, 2020 at 6:17 AM Hans Wennborg <hans at chromium.org> wrote: > > Maybe we can just expand this to always apply: https://reviews.llvm.org/D32330 > > On Fri, Jul 24, 2020 at 2:46 AM David Blaikie via cfe-dev > <cfe-dev at lists.llvm.org> wrote: > > > > LLVM can produce zero length functions from cases like this (when > > optimizations are enabled): > > > > void f1() { __builtin_unreachable(); } &g...
2020 Jul 24
7
Zero length function pointer equality
LLVM can produce zero length functions from cases like this (when optimizations are enabled): void f1() { __builtin_unreachable(); } int f2() { /* missing return statement */ } This code is valid, so long as the functions are never called. I believe C++ requires that all functions have a distinct address (ie: &f1 != &f2) and LLVM optimizes code on this basis (assert(f1 == f2) gets