qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e


From: Peter Maydell
Subject: Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
Date: Tue, 26 Feb 2019 11:05:48 +0000

On Tue, 26 Feb 2019 at 09:06, Thomas Huth <address@hidden> wrote:
> Ok, then that's the problem here: GCC often produces some additional
> "may be unused" warnings with -O3, and we normally only guarantee that
> QEMU compiles without warnings when using the standard -O2 optimization
> level.
> So if you want to compile with -O3, you also have to specify
> --disable-werror (or add -Wno-error=maybe-unitialized to the CFLAGS).
> But unless you have really an urgent need for O3, I'd rather recommend
> to compile with the well-tested O2 optimization level instead.

I think in general we should probably look at fixing warnings
that occur at -O3 when they're reported to us, even if we don't
habitually build that way. But, like using bleeding-edge versions of
gcc or clang, if you use an odd set of optimization flags you might
find you run into warnings we haven't seen yet and need to make them
non-fatal with --disable-werror. (--disable-werror is the default for
releases, so you'll only get compile failures if building from git.)

Actual "QEMU is broken when built with -O3" issues are definitely
worth investigating since they imply either a QEMU bug or a
compiler bug.

PS: in general -O3 is not necessarily going to generate better code
than -O2 if used as a blanket optimization setting -- it can
end up generating larger code that increases icache pressure.
Probably best used carefully and when benchmarking shows that
it's actually an improvement.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]