aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-07-28 15:38:13 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-07-28 15:38:13 -0400
commitc1ceaaa6f282cfde4ec4ebd91ef3630934da1993 (patch)
tree3b358034763c379821251ba4fa2f68e7d5838778
parenta0a34f94fa3e47e07d747d4d17fb6198bcc22724 (diff)
downloadgcc-c1ceaaa6f282cfde4ec4ebd91ef3630934da1993.zip
gcc-c1ceaaa6f282cfde4ec4ebd91ef3630934da1993.tar.gz
gcc-c1ceaaa6f282cfde4ec4ebd91ef3630934da1993.tar.bz2
(copy_for_inline, case LABEL_REF): Properly copy LABEL_REF with LABEL_REF_NONLOCAL_P set.
(copy_for_inline, case LABEL_REF): Properly copy LABEL_REF with LABEL_REF_NONLOCAL_P set. Copy LABEL_OUTSIDE_LOOP_P flag. (copy_rtx_and_substitute, case LABEL_REF): Likewise. (copy_rtx_and_substitute, case CONST): Make recursive call for a LABEL_REF in the constant pool. From-SVN: r5034
-rw-r--r--gcc/integrate.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 8fe1900..8529e4b 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -988,11 +988,14 @@ copy_for_inline (orig)
break;
case LABEL_REF:
- {
- /* Must point to the new insn. */
- return gen_rtx (LABEL_REF, GET_MODE (orig),
- label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]);
- }
+ /* If this is a non-local label, just make a new LABEL_REF.
+ Otherwise, use the new label as well. */
+ x = gen_rtx (LABEL_REF, GET_MODE (orig),
+ LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0)
+ : label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]);
+ LABEL_REF_NONLOCAL_P (x) = LABEL_REF_NONLOCAL_P (orig);
+ LABEL_OUTSIDE_LOOP_P (x) = LABEL_OUTSIDE_LOOP_P (orig);
+ return x;
case REG:
if (REGNO (x) > LAST_VIRTUAL_REGISTER)
@@ -2037,10 +2040,18 @@ copy_rtx_and_substitute (orig, map)
return map->label_map[CODE_LABEL_NUMBER (orig)];
case LABEL_REF:
- copy = rtx_alloc (LABEL_REF);
- PUT_MODE (copy, mode);
- XEXP (copy, 0) = map->label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))];
+ copy = gen_rtx (LABEL_REF, mode,
+ LABEL_REF_NONLOCAL_P (orig) ? XEXP (orig, 0)
+ : map->label_map[CODE_LABEL_NUMBER (XEXP (orig, 0))]);
LABEL_OUTSIDE_LOOP_P (copy) = LABEL_OUTSIDE_LOOP_P (orig);
+
+ /* The fact that this label was previously nonlocal does not mean
+ it still is, so we must check if it is within the range of
+ this function's labels. */
+ LABEL_REF_NONLOCAL_P (copy)
+ = (LABEL_REF_NONLOCAL_P (orig)
+ && ! (CODE_LABEL_NUMBER (XEXP (copy, 0)) >= get_first_label_num ()
+ && CODE_LABEL_NUMBER (XEXP (copy, 0)) < max_label_num ()));
return copy;
case PC:
@@ -2056,16 +2067,12 @@ copy_rtx_and_substitute (orig, map)
{
rtx constant = get_pool_constant (orig);
if (GET_CODE (constant) == LABEL_REF)
- {
- copy = rtx_alloc (LABEL_REF);
- PUT_MODE (copy, mode);
- XEXP (copy, 0)
- = map->label_map[CODE_LABEL_NUMBER (XEXP (constant, 0))];
- LABEL_OUTSIDE_LOOP_P (copy) = LABEL_OUTSIDE_LOOP_P (orig);
- copy = force_const_mem (Pmode, copy);
- return XEXP (copy, 0);
- }
+ return XEXP (force_const_mem (Pmode,
+ copy_rtx_and_substitute (constant,
+ map)),
+ 0);
}
+
return orig;
case CONST_DOUBLE: