On 2012-Sep-04 23:50:35 +0200, Dimitry Andric <d...@freebsd.org> wrote:
>There's a difference between just using '-g', which should never change
>the behaviour of the program at runtime, and adding -DDEBUG or similar
>flags on the command line, which may or may not enable extra code, or
>even cause totally different code paths.

In theory, gcc should generate identical code with and without '-g'
but, last time I looked, adding '-g' causes non-trivial changes in the
gcc code paths so it's quite possible that different code is emitted.

>What is not different, is that both -g and other debugging options will
>generally cause compiling and linking to take longer, since these stages
>will have to process the additional debug information.

As well as being much larger - several times larger is not uncommon.
This further slows things down due to the additional I/O and reduced
cache effectiveness.

-- 
Peter Jeremy

Attachment: pgphfUYAq2ZgX.pgp
Description: PGP signature

Reply via email to