This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix gcse multiple set handling
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to fix gcse multiple set handling
- From: John Wehle <john at feith dot com>
- Date: Sat, 10 Mar 2001 08:54:59 -0500 (EST)
This patch allows an ARM cross compiler to be built. Previously
an INSN containing multiple sets would be recorded and cause
an abort later on in pre_delete. This patch passes make bootstrap
and check on i386-unknown-freebsd4.2. It also passes make check
for powerpc-eabisim.
ChangeLog:
Sat Mar 10 00:46:32 EST 2001 John Wehle (john@feith.com)
* gcse.c (hash_scan_insn): Update comments.
Don't record multiple sets.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/gcse.c.ORIGINAL Thu Mar 1 23:57:34 2001
--- gcc/gcse.c Sat Mar 10 00:34:36 2001
*************** hash_scan_call (x, insn)
*** 2014,2023 ****
Only available expressions that set a single pseudo-reg are recorded.
- Single sets in a PARALLEL could be handled, but it's an extra complication
- that isn't dealt with right now. The trick is handling the CLOBBERs that
- are also in the PARALLEL. Later.
-
If SET_P is non-zero, this is for the assignment hash table,
otherwise it is for the expression hash table.
If IN_LIBCALL_BLOCK nonzero, we are in a libcall block, and should
--- 2014,2019 ----
*************** hash_scan_insn (insn, set_p, in_libcall_
*** 2041,2057 ****
if (GET_CODE (pat) == SET)
hash_scan_set (pat, insn, set_p);
else if (GET_CODE (pat) == PARALLEL)
! for (i = 0; i < XVECLEN (pat, 0); i++)
! {
! rtx x = XVECEXP (pat, 0, i);
!
! if (GET_CODE (x) == SET)
! hash_scan_set (x, insn, set_p);
! else if (GET_CODE (x) == CLOBBER)
! hash_scan_clobber (x, insn);
! else if (GET_CODE (x) == CALL)
! hash_scan_call (x, insn);
! }
else if (GET_CODE (pat) == CLOBBER)
hash_scan_clobber (pat, insn);
--- 2037,2058 ----
if (GET_CODE (pat) == SET)
hash_scan_set (pat, insn, set_p);
else if (GET_CODE (pat) == PARALLEL)
! {
! rtx set = single_set (insn);
!
! if (set)
! hash_scan_set (set, insn, set_p);
!
! for (i = 0; i < XVECLEN (pat, 0); i++)
! {
! rtx x = XVECEXP (pat, 0, i);
!
! if (GET_CODE (x) == CLOBBER)
! hash_scan_clobber (x, insn);
! else if (GET_CODE (x) == CALL)
! hash_scan_call (x, insn);
! }
! }
else if (GET_CODE (pat) == CLOBBER)
hash_scan_clobber (pat, insn);
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------