(copy_rtx_if_shared): A CONST can be shared if it contains a
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 27 Dec 1992 11:52:59 +0000 (06:52 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 27 Dec 1992 11:52:59 +0000 (06:52 -0500)
SYBOL_REF.

From-SVN: r2923

gcc/emit-rtl.c

index 1335308ce87baeca9bb5710482670e8ae497e09f..8291da1b6e4f82265f09b8431ab59b2701a6ba19 100644 (file)
@@ -1267,6 +1267,15 @@ copy_rtx_if_shared (orig)
       /* SCRATCH must be shared because they represent distinct values. */
       return x;
 
+    case CONST:
+      /* CONST can be shared if it contains a SYMBOL_REF.  If it contains
+        a LABEL_REF, it isn't sharable.  */
+      if (GET_CODE (XEXP (x, 0)) == PLUS
+         && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+         && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+       return x;
+      break;
+
     case INSN:
     case JUMP_INSN:
     case CALL_INSN: