[Bug tree-optimization/109440] Missed optimization of vector::at when a function is called inside the loop

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 19 16:22:31 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109440

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I believe that since v is constructed and passed by invisible refernece in the
caller, we would need to know constructors of std::vector and prove that they
do not make &v to escape to global memory, so foo can't access it.

I sent patch that would enable us to optimize provided v is declared const.


More information about the Gcc-bugs mailing list