Hello, Objects generated using '-ggdb3' are different if the compilation process is split in 2 steps (preprocessing and then compilation) or not. The issue can be reproduced for the following 'main.c' code using the commands 'gcc -ggdb3 -c main.c' and 'gcc -ggdb3 -c main.c -E > main.i; gcc -ggdb3 -c main.i'. The resulting sizes are respectively 15400 and 3992 bytes. Using '-ggdb2' the generated objects are the same. I guess some debugging information is lost when the compilation process is split into two steps but as anyway the macro information generated using 'ggdb3' is not usable with gcc 3.4.5 I did not investigated. Does anybody know if this is the expected behavior or if it is a bug? Does a workaround exist? Thanks in advance and best regards, Serge PS: we use gcc 3.4.5 on a Linux/Suse Linux Enterprise Server 9 but the behavior is the same on Solaris 10 (same gcc version). The main.c code: #include <stdio.h> int main(int argc, char **argv) { printf("Hello\n"); return 0; }
What is happening is that -ggdb3 does not enable -dD for the preprocessor.
The workaround is ok for me (but is it the expected behavior?). Best regards, Serge
Confirmed as of today, this is not a regression, a work around is to do -ggdb -g3.
I'm testing a patch to add -dD when -ggdb3 is passed.
Subject: Bug number PR driver/30246 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01757.html
Subject: Bug 30246 Author: tromey Date: Sat Feb 3 19:35:06 2007 New Revision: 121549 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121549 Log: PR driver/30246 * gcc.c (cpp_unique_options): Any of -ggdb3, -gstabs3, -gcoff3, -gxcoff3, -gvms3 implies -dD. Modified: trunk/gcc/ChangeLog trunk/gcc/gcc.c
Fix checked in.