[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2021-07-24 Thread Hi-Angel at yandex dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559 --- Comment #5 from Konstantin Kharlamov --- (In reply to Konstantin Kharlamov from comment #4) > By the way, FTR: I don't have the code anymore, but initially the problem > came from a real-life algorithm involving lots of state, which looked

[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2021-07-24 Thread Hi-Angel at yandex dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559 --- Comment #4 from Konstantin Kharlamov --- By the way, FTR: I don't have the code anymore, but initially the problem came from a real-life algorithm involving lots of state, which looked barely readable when implemented in iterative way (i.e.

[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2021-07-24 Thread Hi-Angel at yandex dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559 --- Comment #3 from Konstantin Kharlamov --- (In reply to Andrew Pinski from comment #2) > I don't think this can ever be optimized. Mainly because there are copies > happening due to passing via value and returning by value. Please correct me

[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559 --- Comment #2 from Andrew Pinski --- I don't think this can ever be optimized. Mainly because there are copies happening due to passing via value and returning by value. If I change it to foo to MyMap (MyMap ), I get the behavior you want.

[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2019-11-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559 Richard Biener changed: What|Removed |Added Keywords||missed-optimization