[patch] emit_library_call/emit_library_call_value fixup.

Catherine Moore clm@cygnus.com
Mon Apr 10 08:25:00 GMT 2000


I was having a problem with emit_library_call's arguments to
locate_and_pad_parm for a 16 bit port which defines REG_PARM_STACK_SPACE.
The compiler was generating a call to _nedf2 (and other routines from dp-bits)
in such a way that an argument that should have been partially passed in regs
and partially on the stack was being passed partially in the regs but fully
on the stack.  So my four word double was passed like this:

  word1 -- arg reg n-1
  word2 -- arg reg n
  word1 -- stack loc 1
  word2 -- stack loc 2
  word3 -- stack loc 3
  word4 -- stack loc 4.

The callee was picking up the args from the expected location.  This patch
brings the behavior of emit_libary call into line with the expand_call 
behavior.  The compiler bootstrapped successfully on a linux/P3 machine.
OK to commit?

Catherine

Sun Apr  9 21:33:32 2000  Catherine Moore  <clm@cygnus.com>
 
        * calls.c (emit_library_call):  Change 3rd arg to 
        locate_and_pad_parm to disregard the setting of partial.
        (emit_library_call_value): Likewise.


Index: calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.116
diff -p -r1.116 calls.c
*** calls.c	2000/04/07 17:44:14	1.116
--- calls.c	2000/04/10 15:05:36
*************** emit_library_call_value_1 (retval, orgfu
*** 3304,3310 ****
  #endif
  
        locate_and_pad_parm (Pmode, NULL_TREE,
! 			   argvec[count].reg && argvec[count].partial == 0,
  			   NULL_TREE, &args_size, &argvec[count].offset,
  			   &argvec[count].size, &alignment_pad);
  
--- 3304,3310 ----
  #endif
  
        locate_and_pad_parm (Pmode, NULL_TREE,
! 			   argvec[count].reg != 0,
  			   NULL_TREE, &args_size, &argvec[count].offset,
  			   &argvec[count].size, &alignment_pad);
  
*************** emit_library_call_value_1 (retval, orgfu
*** 3369,3375 ****
  #endif
  
        locate_and_pad_parm (mode, NULL_TREE,
! 			   argvec[count].reg && argvec[count].partial == 0,
  			   NULL_TREE, &args_size, &argvec[count].offset,
  			   &argvec[count].size, &alignment_pad);
  
--- 3369,3375 ----
  #endif
  
        locate_and_pad_parm (mode, NULL_TREE,
! 			   argvec[count].reg != 0,
  			   NULL_TREE, &args_size, &argvec[count].offset,
  			   &argvec[count].size, &alignment_pad);
  


More information about the Gcc-patches mailing list