public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
@ 2002-03-18  4:56 David Leonard
  0 siblings, 0 replies; 4+ messages in thread
From: David Leonard @ 2002-03-18  4:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR debug/2283; it has been noted by GNATS.

From: David Leonard <david.leonard@itee.uq.edu.au>
To: <rodrigc@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
   <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: debug/2283: -g3 -O1 -finline-function and __attribute__((constructor))
 yield bad stabs
Date: Mon, 18 Mar 2002 22:51:56 +1000 (EST)

 On 18 Mar 2002, rodrigc@gcc.gnu.org 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?
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2283
 
 
 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:
  /usr/include
 End of search list.
 The following default directories have been omitted from the search path:
  /usr/include/g++
 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                           David.Leonard@itee.uq.edu.au
 Dept of Inf. Tech. and Elec. Engg   _   Ph:+61 404 844 850
 The University of Queensland       |+|  http://www.itee.uq.edu.au/~leonard/
 QLD 4072  AUSTRALIA               ~` '~ B73CD65FBEF4C089B79A8EBADF1A932F13EA0FC8
 
 I have some questions about your code - suggestions really, in the form of
 direct orders.  - T Farnon
 
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
@ 2002-03-18  5:06 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2002-03-18  5:06 UTC (permalink / raw)
  To: d, gcc-bugs, gcc-prs, nobody

Synopsis: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Mon Mar 18 05:06:50 2002
State-Changed-Why:
    Since this bug does not occur in newer versions of
    gcc, I'm closing this PR.  You should report it to
    the OpenBSD people, where they can either:
    (1) fix the compiler in the distribution
    (2) upgrade the compiler in the distribution
    
    Not much work is being done on the 2.95 branch by
    the FSF gcc project these days, as the focus is on
    the upcoming 3.1 release.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2283


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
@ 2002-03-17 18:37 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2002-03-17 18:37 UTC (permalink / raw)
  To: d, gcc-bugs, gcc-prs, nobody

Synopsis: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Sun Mar 17 18:37:03 2002
State-Changed-Why:
    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?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2283


^ permalink raw reply	[flat|nested] 4+ messages in thread

* debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
@ 2001-04-01  0:00 d
  0 siblings, 0 replies; 4+ messages in thread
From: d @ 2001-04-01  0:00 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2283
>Category:       debug
>Synopsis:       -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 13 19:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Leonard
>Release:        gcc version 2.95.3 20010112 (prerelease)
>Organization:
>Environment:

Configuration
	I'm using the gcc from OpenBSD 2.8-current (march 2001)
	i386-unknown-openbsd2.8/2.95.3
>Description:

This C compilation unit (called uthread_init.c):

	extern void _thread_init(void);
	void _thread_init_constructor(void) __attribute__((constructor));
	void
	_thread_init_constructor()
	{
		_thread_init();
	}

When compiled like this:

	gcc -v -c  uthread_autoinit.c -g3 -O1 -finline-functions

Produces this error:

	Using builtin specs.
	gcc version 2.95.3 20010112 (prerelease)
	 /usr/lib/gcc-lib/i386-unknown-openbsd2.8/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 uthread_autoinit.c /tmp/ccE31227.i
	GNU CPP version 2.95.3 20010112 (prerelease) (80386, BSD syntax)
	#include "..." search starts here:
	#include <...> search starts here:
	 /usr/include
	End of search list.
	The following default directories have been omitted from the search path:
	 /usr/include/g++
	End of omitted list.
	 /usr/lib/gcc-lib/i386-unknown-openbsd2.8/2.95.3/cc1 /tmp/ccE31227.i -quiet -dumpbase uthread_autoinit.c -g3 -O1 -version -finline-functions -o /tmp/ccU31227.s
	GNU C version 2.95.3 20010112 (prerelease) (i386-unknown-openbsd2.8) compiled by GNU C version 2.95.3 20010112 (prerelease).
	 as -o uthread_autoinit.o /tmp/ccU31227.s
	/tmp/ccU31227.s: Assembler messages:
	/tmp/ccU31227.s:61: Error: Local symbol LBB3 never defined.
	/tmp/ccU31227.s:61: Error: Local symbol LBE3 never defined.
	/tmp/ccU31227.s:61: Fatal error:2 errors, 0 warnings, no object file generated.

With -save-temps, the saved .i file, and the .s file are as follows:

------------------------------------------------------------

# 0 "uthread_autoinit.c"
#define __BASE_FILE__ "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
#define __VERSION__ "2.95.3 20010112 (prerelease)"
# 0 "uthread_autoinit.c"
#define __SIZE_TYPE__ unsigned int
# 0 "uthread_autoinit.c"
#define __PTRDIFF_TYPE__ int
# 0 "uthread_autoinit.c"
#define __WCHAR_TYPE__ int
# 0 "uthread_autoinit.c"
#define __DATE__ "Mar 14 2001"
# 0 "uthread_autoinit.c"
#define __TIME__ "13:04:51"
# 0 "uthread_autoinit.c"
#define __STDC__ 1
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 0 "uthread_autoinit.c"
# 1 "uthread_autoinit.c"

extern void _thread_init(void);

void _thread_init_constructor(void) __attribute__((constructor));
void
_thread_init_constructor()
{
	_thread_init();
}

------------------------------------------------------------

	.file	"uthread_autoinit.c"
gcc2_compiled.:
___gnu_compiled_c:
.stabs "/tmp/",100,0,0,Ltext0
.stabs "uthread_autoinit.c",100,0,0,Ltext0
.text
Ltext0:
.stabs "int:t1=r1;0020000000000;0017777777777;",128,0,0,0
.stabs "char:t2=r2;0;127;",128,0,0,0
.stabs "long int:t3=r1;0020000000000;0017777777777;",128,0,0,0
.stabs "unsigned int:t4=r1;0000000000000;0037777777777;",128,0,0,0
.stabs "long unsigned int:t5=r1;0000000000000;0037777777777;",128,0,0,0
.stabs "long long int:t6=r1;01000000000000000000000;0777777777777777777777;",128,0,0,0
.stabs "long long unsigned int:t7=r1;0000000000000;01777777777777777777777;",128,0,0,0
.stabs "short int:t8=r8;-32768;32767;",128,0,0,0
.stabs "short unsigned int:t9=r9;0;65535;",128,0,0,0
.stabs "signed char:t10=r10;-128;127;",128,0,0,0
.stabs "unsigned char:t11=r11;0;255;",128,0,0,0
.stabs "float:t12=r1;4;0;",128,0,0,0
.stabs "double:t13=r1;8;0;",128,0,0,0
.stabs "long double:t14=r1;12;0;",128,0,0,0
.stabs "complex int:t15=s8real:1,0,32;imag:1,32,32;;",128,0,0,0
.stabs "complex float:t16=r16;4;0;",128,0,0,0
.stabs "complex double:t17=r17;8;0;",128,0,0,0
.stabs "complex long double:t18=r18;12;0;",128,0,0,0
.stabs "void:t19=19",128,0,0,0
	.align 2,0x90
.globl __thread_init_constructor
	.type	__thread_init_constructor , @function
__thread_init_constructor:
	pushl %ebp
	movl %esp,%ebp
	subl $8,%esp
	.stabd 68,0,8
	call __thread_init
	leave
	ret
	.stabd 68,0,9
	.size	__thread_init_constructor , . - __thread_init_constructor
.stabs "_thread_init_constructor:F19",36,0,7,__thread_init_constructor
	.align 2,0x90
.globl __GLOBAL_$I$uthread_autoinit.cgccvPa
	.type	__GLOBAL_$I$uthread_autoinit.cgccvPa , @function
__GLOBAL_$I$uthread_autoinit.cgccvPa:
LBB2:
	pushl %ebp
	movl %esp,%ebp
	subl $8,%esp
	.stabd 68,0,8
	call __thread_init
	leave
	ret
	.stabd 68,0,9
LBE2:
	.stabd 68,0,10
	.size	__GLOBAL_$I$uthread_autoinit.cgccvPa , . - __GLOBAL_$I$uthread_autoinit.cgccvPa
.stabs "_GLOBAL_$I$uthread_autoinit.cgccvPa:F19",36,0,10,__GLOBAL_$I$uthread_autoinit.cgccvPa
.stabn 192,0,0,LBB2
.stabn 192,0,0,LBB3
.stabn 224,0,0,LBE3
.stabn 224,0,0,LBE2
>How-To-Repeat:
compile this C source text

	extern void _thread_init(void);
	void _thread_init_constructor(void) __attribute__((constructor));
	void
	_thread_init_constructor()
	{
		_thread_init();
	}

with this command

	gcc -v -c  uthread_autoinit.c -g3 -O1 -finline-functions

in this environment

	Using builtin specs.
	gcc version 2.95.3 20010112 (prerelease)
	OpenBSD 2.8
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-18 13:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-18  4:56 debug/2283: -g3 -O1 -finline-function and __attribute__((constructor)) yield bad stabs David Leonard
  -- strict thread matches above, loose matches on Subject: below --
2002-03-18  5:06 rodrigc
2002-03-17 18:37 rodrigc
2001-04-01  0:00 d

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).