[Bug lto/104237] [11 Regression] Emitted binary code changes when -g is enabled at -O1 -flto and optimize attribute since r11-3126-ga8f9b4c54cc35062
jakub at gcc dot gnu.org
Wed Jun 1 16:42:42 GMT 2022
--- 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.
More information about the Gcc-bugs