bug in arm-elf-gcc

Vadim Lebedev vlebedev@aplio.fr
Thu May 18 13:23:00 GMT 2000


The following code:

---------------
/* lbtest.c */
void callit1(void*);

extern __inline__ void test()
{
	__label__ l1;

	callit1(&&l1);

l1:

}


void dotest()
{
	test();
}
-----------------

compiled as
arm-elf-gcc -S -O2 lbtest.c

gives following output:
@ Generated by gcc 2.96 20000518 (experimental) for ARM/elf
	.file	"lbtest.c"
gcc2_compiled.:
.text
	.align	2
	.global	dotest
	.type	 dotest,function
dotest:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, current_function_anonymous_args = 0
	ldr	r0, .L7
	@ Sibcall epilogue
	b	callit1
.L8:
	.align	2
.L7:
	.word	.L6  @ !!!!!! non-existant label
.L5:
.Lfe1:
	.size	 dotest,.Lfe1-dotest
	.ident	"GCC: (GNU) 2.96 20000518 (experimental)"


if the same code is compiled with
arm-elf-gcc -S -O2 -fno-optimize-sibling-calls lbtest.c

the generated code is ok.



Vadim



More information about the Gcc-bugs mailing list