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

Re: 1 GCC regressions, 1 new, with your patch on 2000-09-11T23:35:01Z.


Richard Henderson writes:

 > One of these loop patches is at fault.  The loop in question is
 > 
 >   for (i=0 ; i< 7 ; i++)
 >     {
 >       if (i == 7 - 1)
 >         blah = 0xfcc;
 >       else
 >         blah = 0xfee;
 >     }
 > 
 > Yet we decide that we "Can reverse loop".  Clearly that shouldn't
 > happen, since blah will contain incorrect data afterward.

This should have been fixed with the following patch I committed this
morning to loop.c.

Michael


Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.285
diff -c -3 -p -r1.285 loop.c
*** loop.c	2000/09/12 08:39:36	1.285
--- loop.c	2000/09/12 19:34:41
*************** note_addr_stored (x, y, data)
*** 3069,3076 ****
  /* X is a value modified by an INSN that references a biv inside a loop
     exit test (ie, X is somehow related to the value of the biv).  If X
     is a pseudo that is used more than once, then the biv is (effectively)
!    used more than once.  DATA is really an `int *', and is set if the
!    biv is used more than once.  */
  
  static void
  note_set_pseudo_multiple_uses (x, y, data)
--- 3069,3075 ----
  /* X is a value modified by an INSN that references a biv inside a loop
     exit test (ie, X is somehow related to the value of the biv).  If X
     is a pseudo that is used more than once, then the biv is (effectively)
!    used more than once.  DATA is a pointer to a loop_regs structure.  */
  
  static void
  note_set_pseudo_multiple_uses (x, y, data)
*************** note_set_pseudo_multiple_uses (x, y, dat
*** 3097,3103 ****
    if (REGNO (x) >= max_reg_before_loop
        || ! VARRAY_RTX (regs->single_usage, REGNO (x))
        || VARRAY_RTX (regs->single_usage, REGNO (x)) == const0_rtx)
!     *((int *) data) = 1;
  }
  
  /* Return nonzero if the rtx X is invariant over the current loop.
--- 3096,3102 ----
    if (REGNO (x) >= max_reg_before_loop
        || ! VARRAY_RTX (regs->single_usage, REGNO (x))
        || VARRAY_RTX (regs->single_usage, REGNO (x)) == const0_rtx)
!     regs->multiple_uses = 1;
  }
  
  /* Return nonzero if the rtx X is invariant over the current loop.






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