Man gcc indicates -O* flags are selected sets of finer grained optimizations. Perhaps if this is so for -Og, it is possible to build an efficient and debug-friendly Emacs with older versions of GCC by specifying the right set of finer grained optimization flags.