aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-08-31 06:28:16 +0000
committerJeff Law <law@gcc.gnu.org>1999-08-31 00:28:16 -0600
commit835126657b0fcfa7515b819c156751dfc10c9d5a (patch)
treeefe6a39dde5dee4ab7324404a9bb42925b184498 /gcc/emit-rtl.c
parentf425a8879b121e9145d9ce6a614cad1fc41bd50e (diff)
downloadgcc-835126657b0fcfa7515b819c156751dfc10c9d5a.zip
gcc-835126657b0fcfa7515b819c156751dfc10c9d5a.tar.gz
gcc-835126657b0fcfa7515b819c156751dfc10c9d5a.tar.bz2
emit-rtl.c (copy_rtx_if_shared): A MEM which references virtual_stack_vars_rtx or virtual_incoming_args_rtx can...
* emit-rtl.c (copy_rtx_if_shared): A MEM which references virtual_stack_vars_rtx or virtual_incoming_args_rtx can not be shared. From-SVN: r29001
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index b028556..79c179c 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1678,16 +1678,18 @@ copy_rtx_if_shared (orig)
return x;
case MEM:
- /* A MEM is allowed to be shared if its address is constant
- or is a constant plus one of the special registers. */
- if (CONSTANT_ADDRESS_P (XEXP (x, 0))
- || XEXP (x, 0) == virtual_stack_vars_rtx
- || XEXP (x, 0) == virtual_incoming_args_rtx)
+ /* A MEM is allowed to be shared if its address is constant.
+
+ We used to allow sharing of MEMs which referenced
+ virtual_stack_vars_rtx or virtual_incoming_args_rtx, but
+ that can lose. instantiate_virtual_regs will not unshare
+ the MEMs, and combine may change the structure of the address
+ because it looks safe and profitable in one context, but
+ in some other context it creates unrecognizable RTL. */
+ if (CONSTANT_ADDRESS_P (XEXP (x, 0)))
return x;
if (GET_CODE (XEXP (x, 0)) == PLUS
- && (XEXP (XEXP (x, 0), 0) == virtual_stack_vars_rtx
- || XEXP (XEXP (x, 0), 0) == virtual_incoming_args_rtx)
&& CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1)))
{
/* This MEM can appear in more than one place,