This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug lto/82229] GCC7's LTO underperforms compared to GCC6


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]