debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs

David Leonard
Mon Mar 18 05:07:00 GMT 2002

On 18 Mar 2002, typed thusly:
> Synopsis: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
>     Cannot reproduce your problem with gcc 3.0.4
>     or the latest gcc 3.1 pre-release snapshot, under Linux.
>     Is this still a problem under OpenBSD?

yes it is still a problem with the gcc that ships with openbsd 3.0.
with openbsd 2.8 (when i originally filed the bug report) they were using
"gcc version 2.95.3 20010112 (prerelease)", and with 3.0 it is now
"gcc version 2.95.3 20010125 (prerelease)"

Here is that same compilation unit being compiled under openbsd3.0/i386

blackhole:/tmp$ gcc -v -c x.c -g3 -O1 -finline-functions
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd3.0/2.95.3/specs
gcc version 2.95.3 20010125 (prerelease)
 /usr/lib/gcc-lib/i386-unknown-openbsd3.0/2.95.3/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__unix__ -D__i386__ -D__OpenBSD__ -D__unix__ -D__i386__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -g3 x.c /tmp/ccAr8120.i
GNU CPP version 2.95.3 20010125 (prerelease) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/lib/gcc-lib/i386-unknown-openbsd3.0/2.95.3/cc1 /tmp/ccAr8120.i -quiet -dumpbase x.c -g3 -O1 -version -finline-functions -o /tmp/ccvx8120.s
GNU C version 2.95.3 20010125 (prerelease) (i386-unknown-openbsd3.0) compiled by GNU C version 2.95.3 20010125 (prerelease).
 as -o x.o /tmp/ccvx8120.s
/tmp/ccvx8120.s: Assembler messages:
/tmp/ccvx8120.s:61: Error: Local symbol LBB3 never defined.
/tmp/ccvx8120.s:61: Error: Local symbol LBE3 never defined.
/tmp/ccvx8120.s:61: Fatal error:2 errors, 0 warnings, no object file generated.

David Leonard                 
Dept of Inf. Tech. and Elec. Engg   _   Ph:+61 404 844 850
The University of Queensland       |+|
QLD 4072  AUSTRALIA               ~` '~ B73CD65FBEF4C089B79A8EBADF1A932F13EA0FC8

I have some questions about your code - suggestions really, in the form of
direct orders.  - T Farnon

More information about the Gcc-bugs mailing list