This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug with stabs output


The follow note is for output from "GNU C 2.96 19990715 (experimental)",
but the problem existed long before that version.

When the following code is compiled for target vms/vax (for which gcc
is in general currently broken), the stabs info contains a serious
problem and minor one.

In the .s file below, notice that the type of "stack" is 20, this
is EPG, however the fact that EPG is the same as struct __epg can
not be determined from the stab entry for EPG or __epg . The
suggested correct stabs lines are found at the end of this mail.

There is also a possible problem with the range of "char", being
given as 0..127 rather than -128..127.

=====test_stabs.c======
struct __epg;
typedef struct __epg EPG;
struct __epg {
	void	 *page;
};
typedef struct __epg EPG2;
struct __cursor {
	EPG	*sp;
	EPG	stack[5];
};

void *
test (struct __cursor *cur)
{
  return cur->stack[0].page;
}
====End of test_stabs.c=========
====test_stabs.s================
	.version	"GNU C 2.96 19990715 (experimental)"
#NO_APP
gcc2_compiled.:
___gnu_compiled_c:
___vax_d_doubles:
.stabs "test_stabs.c",100,0,0,Ltext0
	.text
Ltext0:
.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0
.stabs "char:t2=r2;0;127;",128,0,0,0
                   !
.stabs "long int:t3=r3;-2147483648;2147483647;",128,0,0,0
.stabs "unsigned int:t4=r4;0;-1;",128,0,0,0
.stabs "long unsigned int:t5=r5;0;-1;",128,0,0,0
.stabs "long long int:t6=r6;0;-1;",128,0,0,0
.stabs "long long unsigned int:t7=r7;0;-1;",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;8;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;8;0;",128,0,0,0
.stabs "void:t19=19",128,0,0,0
.stabs "EPG:t20",128,0,0,0
.stabs "__epg:T21=s4page:22=*19,0,32;;",128,0,0,0
.stabs "EPG2:t23=21",128,0,0,0
.stabs "__cursor:T24=s24sp:25=*20,0,32;stack:26=ar1;0;4;20,32,160;;",128,0,0,0
                                                        !!
	.align 1
	.globl _test
_test:
	.stabd 68,0,14
	.word 0x0
	subl2 $4,sp
	movl 4(ap),r0
	.stabd 68,0,15
	movl 4(r0),r0
	ret
	.stabd 68,0,16
.stabs "test:F22",36,0,0,_test
.stabs "cur:p27=*24",160,0,0,4
.stabs "cur:r27",64,0,0,0
=====End of test_stabs.s=======

This should be?

.stabs "char:t2=r2;-128;127;",128,0,0,0

(There seem to be a number of places in dbxout.c where the range of
"char" is specified incorrectly.)

and later

.stabs "EPG:t20=s4page:22=*19,0,32;;",128,0,0,0
.stabs "__epg:T21=20",128,0,0,0

Any stabs/dbxout.c experts about?

Clive


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]