[Bug c++/80093] missed optimization opportunity with std::uniform_int_distribution

2018-08-24 Thread trashyankes at wp dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80093

trashyankes at wp dot pl changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from trashyankes at wp dot pl ---
fixed in 8.1

[Bug c++/80093] missed optimization opportunity with std::uniform_int_distribution

2017-03-23 Thread trashyankes at wp dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80093

--- Comment #2 from trashyankes at wp dot pl ---
```
#include 

int foo (std::mt19937* x)
{
  std::uniform_int_distribution k(0, 99);
  for (auto i = 0; i < 1'000'000'000; ++i)
  {
std::uniform_int_distribution y(0, 99);
volatile auto r = k(*x, k.param()); //change any of `k` to `y` simplify
code
  }
}
```

This `operator()` do not use any members fields of `k` directly, therefore `y`
should give exactly same results but it isn't. This function depends on `k`
even if do not need to do this.

[Bug c++/80093] missed optimization opportunity with std::uniform_int_distribution

2017-03-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80093

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-03-20
 CC||hubicka at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
With -O2 they are comparable.  With -O3 we inline more into bar while we inline
into a IPA-CPed clone of operator() in foo instead.

Not sure where the differences are exactly, -fdump-ipa-inline-details will
tell you ... ;)