This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
small CSE bugfix
- To: gcc-patches at gcc dot gnu dot org
- Subject: small CSE bugfix
- From: Denis Chertykov <denisc at overta dot ru>
- Date: Mon, 23 Jul 2001 23:52:02 +0400
- CC: denisc at overta dot ru
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.
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 Mon Jul 23 23:36:01 2001
*************** cse_process_notes (x, object)
*** 6485,6493 ****
&& (CONSTANT_P (ent->const_rtx)
|| GET_CODE (ent->const_rtx) == REG))
{
! rtx new = gen_lowpart_if_possible (GET_MODE (x), ent->const_rtx);
! if (new)
! return new;
}
}
--- 6485,6498 ----
&& (CONSTANT_P (ent->const_rtx)
|| GET_CODE (ent->const_rtx) == REG))
{
! if (object &&
! memory_address_p (GET_MODE (object), ent->const_rtx))
! {
! rtx new;
! new = gen_lowpart_if_possible (GET_MODE (x), ent->const_rtx);
! if (new)
! return new;
! }
}
}