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

Re: 4 GCC regressions, 2 new, with your patch on 2002-07-18T09:56:17Z.


> On Mon, Jul 22, 2002 at 03:39:57PM +0200, Jan Hubicka wrote:
> > The code is wrong as well I believe.  It should verify whether the code
> > in between earliest and jump change the operands used by to be inserted
> > instruction. This is bit tricky to do, I plan to do in separate patch.
> 
> This is already done.  The problem must be something else.
It does not appear to work. The code uses reg_mentioned_p (I am refering
to line 1793 in ifcvt.c) for set destination, but in this case the
destination is memory and the address is being computed in between, so
we lose.
The attached patch solves the problem by adding modified_in_p call for
X, but unfortunately the function is overly pesimistic about memory
references and thus we de-facto lose any chance to optimize memory
stores.  Any ideas for better fix?

I am not quite sure about my schedule tomorrow and possibly I won't be
able to read email...

Honza

Mon Jul 22 22:24:39 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* ifcvt.c (noce_process_if_block): Verify that X is not
	modified.
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ifcvt.c,v
retrieving revision 1.98
diff -c -3 -p -r1.98 ifcvt.c
*** ifcvt.c	21 Jul 2002 14:32:24 -0000	1.98
--- ifcvt.c	22 Jul 2002 20:22:41 -0000
*************** noce_process_if_block (ce_info)
*** 1791,1797 ****
  
    /* X may not be mentioned in the range (cond_earliest, jump].  */
    for (insn = jump; insn != if_info.cond_earliest; insn = PREV_INSN (insn))
!     if (INSN_P (insn) && reg_mentioned_p (x, insn))
        return FALSE;
  
    /* A and B may not be modified in the range [cond_earliest, jump).  */
--- 1791,1798 ----
  
    /* X may not be mentioned in the range (cond_earliest, jump].  */
    for (insn = jump; insn != if_info.cond_earliest; insn = PREV_INSN (insn))
!     if (INSN_P (insn) 
! 	&& (reg_mentioned_p (x, insn) || modified_in_p (x, insn)))
        return FALSE;
  
    /* A and B may not be modified in the range [cond_earliest, jump).  */


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