This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: unsharing rtl too early
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: unsharing rtl too early
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 20 May 2000 07:24:42 -0300
- Cc: law at cygnus dot com, gcc-patches at gcc dot gnu dot org
- Organization: Cygnus Solutions, a Red Hat Company
- References: <524.958709851@upchuck> <jm66sa16pi.fsf@envy.cygnus.com>
On May 19, 2000, Geoff Keating <geoffk@cygnus.com> wrote:
> IIRC, I fixed that for m68k. The problem was that RTL was being
> shared between the procedure arguments (stored off the tree) and the
> actual RTL of the procedure.
> The problem was an insn like
> (parallel [(set (...) (div (match_operand 0) (match_operand 1)))
> (set (...) (mod (match_dup 0) (match_dup 1)))])
This is *exactly* the same problem I have on mn10300.
> I fixed it by causing unshare_all_* to unshare those too.
It would certainly have helped to store the rtl returned by
copy_rtx_if_shared :-)
This patch fixes the problem on mn10300. Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@cygnus.com>
* emit-rtl.c (unshare_all_rtl): Store the copied rtx.
Index: gcc/emit-rtl.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/emit-rtl.c,v
retrieving revision 1.153
diff -u -r1.153 emit-rtl.c
--- gcc/emit-rtl.c 2000/05/15 17:46:19 1.153
+++ gcc/emit-rtl.c 2000/05/20 10:24:25
@@ -1695,7 +1695,7 @@
/* Make sure that virtual parameters are not shared. */
for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
- copy_rtx_if_shared (DECL_RTL (decl));
+ DECL_RTL (decl) = copy_rtx_if_shared (DECL_RTL (decl));
/* Unshare just about everything else. */
unshare_all_rtl_1 (insn);
@@ -1707,7 +1707,7 @@
This special care is necessary when the stack slot MEM does not
actually appear in the insn chain. If it does appear, its address
is unshared from all else at that point. */
- copy_rtx_if_shared (stack_slot_list);
+ stack_slot_list = copy_rtx_if_shared (stack_slot_list);
}
/* Go through all the RTL insn bodies and copy any invalid shared
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me