https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #12 from Jason ---
This significant change appears to have been resolved in g++ v8.1.0. So now g++
does the same as the massive corpus of computer science and other compilers.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #11 from Joshua Green ---
(In reply to Segher Boessenkool from comment #10)
> GCC thinks bar2 will be executed more often that bar1; the code
> it generates is perfectly fine for that.
>
> If you think GCC's heuristics for branch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #10 from Segher Boessenkool ---
GCC thinks bar2 will be executed more often that bar1; the code
it generates is perfectly fine for that.
If you think GCC's heuristics for branch prediction are no good,
could use some improvement,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #7 from Joshua Green ---
(In reply to Segher Boessenkool from comment #6)
> bb-reorder changes the conditional branch so that the fallthrough path
> is the most likely. It now also does this for -O1. This is faster on
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #8 from Segher Boessenkool ---
(In reply to Joshua Green from comment #7)
> and I see no reason why expecting the "else" block should a priori be
> preferable in either case.
GCC does some fairly involved prediction (in predict.c).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
--- Comment #9 from Joshua Green ---
(In reply to Segher Boessenkool from comment #8)
> GCC does some fairly involved prediction (in predict.c). It isn't
> "a priori".
>
> > (It's also not clear HOW this could be "faster
> > on essentially all
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
Segher Boessenkool changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
jvg1981 at aim dot com changed:
What|Removed |Added
CC||jvg1981 at aim dot com
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66573
Andrew Pinski pinskia at gcc dot gnu.org changed:
What|Removed |Added
Component|rtl-optimization