Looking through the compiler settings, it appears that Linux builds with -O2 because there was a problem with -O3 in the compiler. However that problem was reported 5 years ago in an old version. Is it still a problem? Would it be possible to start using -O3 instead of -O2 now?
I’m looking at the code here:
Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
specifically this line:
Result += " -O2"; // warning: as of now (2014-09-28), clang 3.5.0 miscompiles PlatformerGame with -O3 (bitfields?)
It would be nice to be able to build with more optimizations if possible.
Even if PlatformerGame still does not work with -O3, that is just a sample game and not part of Unreal itself, so doesn’t seem like a strong reason to disable -O3 globally.