the failure in store motion

Jan Hubicka jh@suse.cz
Mon Aug 6 03:59:00 GMT 2001


Hi,
looking at the failure, it seems to me that it is due to bug in 
store_killed_in_insn_p.
It is wrong, as mentioned by Graham for pure insns, but on the i386
even for const calls, as the arguments are passed on the stack.

You must check the function ussage to kill the stores completely

Like this:

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcse.c,v
retrieving revision 1.144
diff -c -3 -p -r1.144 gcse.c
*** gcse.c	2001/08/04 06:07:59	1.144
--- gcse.c	2001/08/06 10:58:07
*************** store_killed_in_insn (x, insn)
*** 6513,6519 ****
    
    if (GET_CODE (insn) == CALL_INSN)
      {
!       if (CONST_CALL_P (insn))
  	return 0;
        else
  	return 1;
--- 6512,6519 ----
    
    if (GET_CODE (insn) == CALL_INSN)
      {
!       if (CONST_CALL_P (insn)
! 	  && !find_loads (CALL_INSN_FUNCTION_USAGE (insn)))
  	return 0;
        else
  	return 1;



More information about the Gcc mailing list