This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/82229] GCC7's LTO underperforms compared to GCC6
- From: "krzysio.kurek at wp dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 15 Apr 2018 11:05:11 +0000
- Subject: [Bug lto/82229] GCC7's LTO underperforms compared to GCC6
- Auto-submitted: auto-generated
- References: <bug-82229-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82229
--- Comment #19 from krzysio.kurek at wp dot pl ---
I'm sorry if it's not clear, English isn't my native language.
So to reiterate.
The normal, unoptimized path is:
World::update() simulates world which uses Random::get() to generate a random
number. Random::get() calls std::uniform_int_distribution, which then calls
std::mersenne_twister_engine().
And this is what GCC7 uses.
Now GCC6 with LTO manages to optimize the path by:
Calling Random::get() only once per frame.
Omitting std::uniform_int_distribution, calling std::mersenne_twister_engine()
instead every time a random number is needed.