This is the mail archive of the gcc@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]

help :: virtual-incoming-args



hi,

  I am a newcomer in gcc and port gcc-3.3.2 to
  a new arch.  we have done the first version header(.h), 
  md file and library file (.c) and build a compiler.  
  It can pass almost the compiling test patterns 
  that find in testsuite/gcc.c-torture/compile.

  There is got a problem in 64-bit return value,

  we write an simple function add like this
  ========================================
  long long add(long long a, long long b)
    {
       return a+b;
    }
  ==========================================
  and compile it with gcc and got the assemble file,
  the return value r4 was destroyed before function_epilogue.
  we find a pair of dump store/load instruction
  ===> sw r4,[r2,64] and lw r4,[r2,64]  <=======
  that destory the return value.

  We had check the rtl file that dump by gcc with -da option and
  find  insn 3 is some thing about virtual-incoming-args.
  the rtl file show below.
 
  Any one know the problem? thanks!

  ull.c.00.rtl
===========================================================
  (insn 3 2 4 (nil) (set (reg/v/f:SI 37)
        (reg:SI 4 r4)) -1 (nil)
    (expr_list:REG_EQUIV (mem/f:SI (reg/f:SI 32 virtual-incoming-args) [0 <anonymous>+0 S4 A32])
        (nil)))
============================================================
  ull.c.26.flow2
============================================================
(insn 3 31 4 0 (nil) (set (mem/f:SI (plus:SI (reg/f:SI 2 r2)
                (const_int 64 [0x40])) [0 <anonymous>+0 S4 A32])
        (reg:SI 4 r4)) 2 {movsi_internal} (nil)
    (expr_list:REG_EQUIV (mem/f:SI (plus:SI (reg/f:SI 29 r29)
                (const_int 4 [0x4])) [0 <anonymous>+0 S4 A32])
        (nil)))
============================================================
  

  ==========================================
  	.globl	add
add:
	.stabn 68,0,3,LM1-add
LM1:
	sw	r2,[r0,-4]+
	sw	r3,[r0,-4]+
	subi	r0,52
	mv	r2,r0
	@========================= end function_prologue
	@ movsi [r2,64] r4
	sw	r4,[r2,64] @===== dummy store
	@ movdi [r2] r5

	======put the return value in r4:r5
................................
LM3:
	@ movsi r4 [r2,64]
	lw	r4,[r2,64] @===== dummy load
	@========================= begin function_epilogue 
	addi	r0,52
	lw	r3,[r0]+,4
	lw	r2,[r0]+,4
	br	r3

==========================================  





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