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]

Re: small CSE bugfix


Denis Chertykov <denisc@overta.ru> writes:

> I got an internal error (unrecognizable insn) in
> target whithout the memory access by constant address.
> IE:
> 
> int
> legitimate_address_p (mode, x, strict)
>      enum machine_mode mode;
>      rtx x;
>      int strict;
> {
>   if (CONSTANT_ADDRESS_P (x))
>     return 0;
> 
> 
> 
> This small patch make the `cse_process_notes' more close to his
> description.
> 
> /* Process X, part of the REG_NOTES of an insn.  Look at any REG_EQUAL notes
>    and replace any registers in them with either an equivalent constant
>    or the canonical form of the register.  If we are inside an address,
>                                            ---------------------------
>    only do this if the address remains valid.
>    ------------------------------------------
>    OBJECT is 0 except when within a MEM in which case it is the MEM.
> 
>    Return the replacement for X.  */
> 
> 
> Ok to apply to GCC-3.0.1 and to GCC-3.1 ?
> 
> 
> 
> Mon Jul 23 23:34:19 2001  Denis Chertykov  <denisc@overta.ru>
> 
> 	* cse.c (cse_process_notes): Replace any registers if the address
> 	remains valid.
> 

Oops. Sorry. :(

IMHO: my previous patch was not correct.

Better patch.

diff -c3p /root/d/cvs/gcc-3.0/gcc/ /root/d/Work/gcc-3.0/gcc/cse.c
*** /root/d/cvs/gcc-3.0/gcc/cse.c	Sat Jun  2 00:10:17 2001
--- /root/d/Work/gcc-3.0/gcc/cse.c	Tue Jul 24 00:03:53 2001
*************** cse_process_notes (x, object)
*** 6450,6456 ****
        return x;
  
      case MEM:
!       XEXP (x, 0) = cse_process_notes (XEXP (x, 0), x);
        return x;
  
      case EXPR_LIST:
--- 6450,6457 ----
        return x;
  
      case MEM:
!       validate_change (x, &XEXP (x, 0),
! 		       cse_process_notes (XEXP (x, 0), x), 0);
        return x;
  
      case EXPR_LIST:





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