summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-01-03 17:16:04 +0000
committerobrien <obrien@FreeBSD.org>2001-01-03 17:16:04 +0000
commite103926ab58446425b46d5df55c940db3abeff84 (patch)
tree46177f22832f755e34be042b91555eedf10b4f66 /contrib/gcc/emit-rtl.c
parentd566d0a5f8c3f4d187ecbf8096628e9ae9dd3567 (diff)
downloadFreeBSD-src-e103926ab58446425b46d5df55c940db3abeff84.zip
FreeBSD-src-e103926ab58446425b46d5df55c940db3abeff84.tar.gz
Enlist the FreeBSD-CURRENT users as testers of GCC 2.95.3 Release Candidate #1
Diffstat (limited to 'contrib/gcc/emit-rtl.c')
-rw-r--r--contrib/gcc/emit-rtl.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/contrib/gcc/emit-rtl.c b/contrib/gcc/emit-rtl.c
index 36b030a..54cee16 100644
--- a/contrib/gcc/emit-rtl.c
+++ b/contrib/gcc/emit-rtl.c
@@ -1847,25 +1847,17 @@ 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,
- but its address better not be shared with anything else. */
- if (! x->used)
- XEXP (x, 0) = copy_rtx_if_shared (XEXP (x, 0));
- x->used = 1;
- return x;
- }
break;
default:
@@ -2359,10 +2351,18 @@ try_split (pat, trial, last)
it, in turn, will be split (SFmode on the 29k is an example). */
if (GET_CODE (seq) == SEQUENCE)
{
+ int i;
+
+ /* Avoid infinite loop if any insn of the result matches
+ the original pattern. */
+ for (i = 0; i < XVECLEN (seq, 0); i++)
+ if (GET_CODE (XVECEXP (seq, 0, i)) == INSN
+ && rtx_equal_p (PATTERN (XVECEXP (seq, 0, i)), pat))
+ return trial;
+
/* If we are splitting a JUMP_INSN, look for the JUMP_INSN in
SEQ and copy our JUMP_LABEL to it. If JUMP_LABEL is non-zero,
increment the usage count so we don't delete the label. */
- int i;
if (GET_CODE (trial) == JUMP_INSN)
for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
OpenPOWER on IntegriCloud