You copied the Doc URL to your clipboard.

-g

This option enables the generation of debug tables for the current compilation.

The compiler produces the same code regardless of whether -g is used. The only difference is the existence of debug tables.

Using -g does not affect optimization settings.

Default

By default, using the -g option alone is equivalent to:

-g --dwarf3 --debug_macros