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]
Other format: [Raw text]

[Bug target/6431] [v850] va_arg() fails in expanding arguments


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6431



------- Additional Comments From markku.pihlajamaa@luukku.com  2003-06-04 10:04 -------
Thank you. I have just been able to try with 3.1.1., 
and as far as I understand it seems to be O.K.
Regards, 
Markku

***************************************************

#include <stdarg.h>

extern int out ( int );

void test( int parc, ... )
{
    va_list list;
    
    va_start( list, parc );
    
    while( parc )
    {
        int i;
        
        i = va_arg( list, int );

        out( i );
        
        parc --;
    }

    va_end( list );
}


int main( void )
{
    test( 4, 1, 2, 3, 4 );
    
    return 0;
}


************************************************************


	.file	"va_arg.c"
gcc2_compiled.:
	.section .text
	.align 1
	.global _test
	.type	 _test,@function
_test:
	st.w r6,0[sp]
	st.w r7,4[sp]
	st.w r8,8[sp]
	st.w r9,12[sp]
	addi -36,sp,sp
	st.w r31,32[sp]
	st.w r28,28[sp]
	st.w r29,24[sp]
	mov sp,r29
	st.w r6,36[r29]
	addi 40,r29,r10
	st.w r10,20[r29]
.L3:
	ld.w 36[r29],r10
	cmp r0,r10
	bne .L5
	br .L4
.L5:
	ld.w 20[r29],r28
	ld.w 20[r29],r10
	addi 4,r10,r11
	st.w r11,20[r29]
	ld.w 0[r28],r10
	st.w r10,16[r29]
	ld.w 16[r29],r6
	jarl _out,r31
	ld.w 36[r29],r10
	addi -1,r10,r11
	st.w r11,36[r29]
	br .L3
.L4:
.L2:
	mov r29,sp
	ld.w 32[sp],r31
	ld.w 28[sp],r28
	ld.w 24[sp],r29
	addi 36,sp,sp
	jmp [r31]
.Lfe1:
	.size	 _test,.Lfe1-_test
	.align 1
	.global _main
	.type	 _main,@function
_main:
	addi -28,sp,sp
	st.w r31,24[sp]
	st.w r29,20[sp]
	mov sp,r29
	mov 4,r10
	st.w r10,16[sp]
	mov 4,r6
	mov 1,r7
	mov 2,r8
	mov 3,r9
	jarl _test,r31
	mov 0,r10
	br .L6
.L6:
	mov r29,sp
	ld.w 24[sp],r31
	ld.w 20[sp],r29
	addi 28,sp,sp
	jmp [r31]
.Lfe2:
	.size	 _main,.Lfe2-_main
	.ident	"GCC: (GNU) 2.96-xscale-010827"


***********************************************************


	.file	"va_arg.c"
	.section .text
	.align 1
	.global _test
	.type	_test,@function
_test:
	st.w r6,0[sp]
	st.w r7,4[sp]
	st.w r8,8[sp]
	st.w r9,12[sp]
	addi -32,sp,sp
	st.w r31,28[sp]
	st.w r29,24[sp]
	mov sp,r29
	st.w r6,32[r29]
	addi 36,r29,r10
	st.w r10,20[r29]
.L2:
	ld.w 32[r29],r10
	cmp r0,r10
	bne .L4
	br .L1
.L4:
	ld.w 20[r29],r11
	addi 4,r11,r10
	st.w r10,20[r29]
	ld.w 0[r11],r10
	st.w r10,16[r29]
	ld.w 16[r29],r6
	jarl _out,r31
	ld.w 32[r29],r10
	add -1,r10
	st.w r10,32[r29]
	br .L2
.L1:
	mov r29,sp
	ld.w 28[sp],r31
	ld.w 24[sp],r29
	addi 32,sp,sp
	jmp [r31]
.Lfe1:
	.size	_test,.Lfe1-_test
	.align 1
	.global _main
	.type	_main,@function
_main:
	addi -28,sp,sp
	st.w r31,24[sp]
	st.w r29,20[sp]
	mov sp,r29
	mov 4,r10
	st.w r10,16[sp]
	mov 4,r6
	mov 1,r7
	mov 2,r8
	mov 3,r9
	jarl _test,r31
	mov 0,r10
	mov r29,sp
	ld.w 24[sp],r31
	ld.w 20[sp],r29
	addi 28,sp,sp
	jmp [r31]
.Lfe2:
	.size	_main,.Lfe2-_main
	.ident	"GCC: (GNU) 3.1.1"





------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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