https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104549
--- Comment #4 from Cristian Assaiante <assaiante at diag dot uniroma1.it> --- We have tested also multiple versions of gdb. With versions 9.2 and 11.2 we have the same behavior: variable i is visible for gcc4 and gcc7 and not visible for more recent gcc versions. With version 10.2 we have that variable i is marked as optimized out for gcc4 and gcc7 and not visible for more recent gcc versions.