stdcall function does not return floating point result - bug in reg-stack.c

Richard Henderson rth@cygnus.com
Tue Mar 9 11:38:00 GMT 1999


On Sun, Feb 14, 1999 at 07:54:08PM +1100, Tim Josling wrote:
> I traced the problem down to a bug in reg-stack.c. See 5 for the patch.
> The problem is that in routine stack_reg_life_analysis it tries to check
> if the block does a return from the function by checking if the last
> insn of each block is a jump with return, or for the last block any
> instruction with return. However in a stdcall function, the return
> instruction is a PARALLEL with the return under the parallel so the code
> does not find it ...

Thanks for the analysis.  I've checked in the following to address 
the problem.


r~


        * reg-stack.c (stack_reg_life_analysis): Use returnjump_p
        instead of an explicit test for RETURN.

Index: reg-stack.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reg-stack.c,v
retrieving revision 1.26
diff -c -p -d -r1.26 reg-stack.c
*** reg-stack.c	1999/02/25 23:45:27	1.26
--- reg-stack.c	1999/03/09 19:34:54
*************** stack_reg_life_analysis (first, stackent
*** 1199,1205 ****
  
          for (block = blocks - 1; --block >= 0;)
  	   if (GET_CODE (block_end[block]) == JUMP_INSN
! 	     && GET_CODE (PATTERN (block_end[block])) == RETURN)
  	      mark_regs_pat (retvalue, block_out_reg_set+block);
  
          /* Mark off the end of last block if we "fall off" the end of the
--- 1199,1205 ----
  
          for (block = blocks - 1; --block >= 0;)
  	   if (GET_CODE (block_end[block]) == JUMP_INSN
! 	       && returnjump_p (block_end[block]))
  	      mark_regs_pat (retvalue, block_out_reg_set+block);
  
          /* Mark off the end of last block if we "fall off" the end of the


More information about the Gcc-bugs mailing list