This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
SH: abort in reg_overlap_mentioned_for_reload_p
- To: gcc-patches at gcc dot gnu dot org
- Subject: SH: abort in reg_overlap_mentioned_for_reload_p
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Sun, 02 Sep 2001 12:57:51 +0900
When I tried to run C testsuits for SH, some tests aborted in
reg_overlap_mentioned_for_reload_p(X, IN).
The tests
gcc.c-torture/compile/920501-4.c
gcc.c-torture/compile/950612-1.c
gcc.dg/sequence-pt-1.c
abort since X has the form like
(plus:SI (reg/f:SI 14 r14) (const_int 124 [0x7c]))
and
gcc.c-torture/compile/990517-1.c
aborts since X has the form
(post_inc:SI (mem:SI (plus:SI (plus:SI (reg/f:SI 14 r14)
(const_int 1020 [0x3fc]))
(const_int 20 [0x14])) 12))
in reg_overlap_mentioned_for_reload_p function.
The following patch is a workaround for this.
Bootstrapped and regression tested on i686-linux and sh-linux.
kaz
--
2001-09-02 kaz Kojima <kkojima@rr.iij4u.or.jp>
* reload.c (reg_overlap_mentioned_for_reload_p): Handle
POST_INC / POST_DEC / PRE_INC / PRE_DEC and the rtx for
the register plus constant.
Index: reload.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload.c,v
retrieving revision 1.159
diff -u -r1.159 reload.c
--- reload.c 2001/08/31 14:49:31 1.159
+++ reload.c 2001/09/02 01:29:29
@@ -6131,6 +6131,12 @@
else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
|| GET_CODE (x) == CC0)
return reg_mentioned_p (x, in);
+ else if (GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_INC
+ || GET_CODE (x) == POST_DEC || GET_CODE (x) == PRE_DEC)
+ return refers_to_mem_for_reload_p (in);
+ else if (GET_CODE (x) == PLUS
+ && GET_CODE (XEXP (x, 0)) == REG && CONSTANT_P (XEXP (x, 1)))
+ return 0;
else
abort ();