https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104237
--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #19) > (In reply to Chengnian Sun from comment #18) > > Hello folks, > > > > While testing gcc with -fcompare-debug, I was asked a question which puzzled > > me as well. > > > > What if we always enable -g, and use 'strip' to remove debug information > > from the binary file? Then we do not need to pay much attention to bugs > > detected by -fcompare-debug. > > because -g has a compile time overhead and even an assembler time overhead; > in some cases the debugging informationg is huge even for small programs. > Plus there are different levels of -g: -g1, -g2, and -g3 (-g is the same as > -g2). So which one would you enable by default? We could just enable -fvar-tracking-assignments and then just throw that info before var-tracking if -g0. But that would still cause significant IL growth and compile time increase when debug info isn't needed.