I went ahead and wrote a clang-tidy pass that attempts to find other
cases of this behavior (i.e. compile-time short-circuit behavior that
could lead to undefined references). All of these cases should also be
caught by `-Wunreachable-code`, but that uncovers a lot and I'd like a
green light before
>From their Discord server in reply to a question about whether such a
patch would be upstreamed: "I suspect this only works in gcc -O0
because of its AST-level "fold", which clang intentionally doesn't
implement. So probably not."
I hope that's enough information to resolve this patch. If any of
I'm writing a patch to clang's constant folding to address this case
(doesn't seem too difficult). I'll either follow up with a link to
some submissions I've made or a bug report on the project describing
the issue.
On Tue, Nov 21, 2023 at 10:15 AM Eric Blake wrote:
>
> On Mon, Nov 20, 2023 at
On Mon, Nov 20, 2023 at 11:20:52AM +0100, Philippe Mathieu-Daudé wrote:
> (Cc'ing Eric)
>
> On 20/11/23 10:28, Michael S. Tsirkin wrote:
> > On Sun, Nov 19, 2023 at 07:34:58PM -0600, Dan Hoffman wrote:
> > > As far as I can tell, yes. Any optimization level above O0 does not have
> > > this
> > >
On 11/20/23 02:20, Philippe Mathieu-Daudé wrote:
(Cc'ing Eric)
On 20/11/23 10:28, Michael S. Tsirkin wrote:
On Sun, Nov 19, 2023 at 07:34:58PM -0600, Dan Hoffman wrote:
As far as I can tell, yes. Any optimization level above O0 does not have this
issue (on this version of Clang, at least)
Ah
(Cc'ing Eric)
On 20/11/23 10:28, Michael S. Tsirkin wrote:
On Sun, Nov 19, 2023 at 07:34:58PM -0600, Dan Hoffman wrote:
As far as I can tell, yes. Any optimization level above O0 does not have this
issue (on this version of Clang, at least)
Aha, this is with -O0. That makes sense.
But then,
On Sun, Nov 19, 2023 at 07:34:58PM -0600, Dan Hoffman wrote:
> As far as I can tell, yes. Any optimization level above O0 does not have this
> issue (on this version of Clang, at least)
Aha, this is with -O0. That makes sense.
We have:
;;
--enable-debug)
# Enable debugging options that a
As far as I can tell, yes. Any optimization level above O0 does not have
this issue (on this version of Clang, at least)
On Sun, Nov 19, 2023 at 4:54 PM Philippe Mathieu-Daudé
wrote:
> Hi,
>
> On 19/11/23 21:31, Daniel Hoffman wrote:
> > `kvm_enabled()` is compiled down to `0` and short-circuit
Hi,
On 19/11/23 21:31, Daniel Hoffman wrote:
`kvm_enabled()` is compiled down to `0` and short-circuit logic is
used to remove references to undefined symbols at the compile stage.
Some build configurations with some compilers don't attempt to
simplify this logic down in some cases (the pattern
`kvm_enabled()` is compiled down to `0` and short-circuit logic is
used to remove references to undefined symbols at the compile stage.
Some build configurations with some compilers don't attempt to
simplify this logic down in some cases (the pattern appears to be
that the literal false must be the
10 matches
Mail list logo