https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77411
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> --- Analysis at https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01985.html : ... The problem here is that the functions f2 and f3 access a stack- based object out of bounds and that is inlined in main and therefore smashes the return address of main in this case. ...