(do_tablejump): Use PIC_CASE_VECTOR_ADDRESS if defined.
authorRichard Stallman <rms@gnu.org>
Sun, 1 Aug 1993 20:11:48 +0000 (20:11 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 1 Aug 1993 20:11:48 +0000 (20:11 +0000)
From-SVN: r5050

gcc/expr.c

index 85f78a7dfc6022b18480b14fc3d381e9b4f4bfef..c0320249d0d188692a575db987f36c968cb7ddde 100644 (file)
@@ -8145,12 +8145,16 @@ do_tablejump (index, mode, range, table_label, default_label)
      GET_MODE_SIZE, because this indicates how large insns are.  The other
      uses should all be Pmode, because they are addresses.  This code
      could fail if addresses and insns are not the same size.  */
-  index = memory_address_noforce
-    (CASE_VECTOR_MODE,
-     gen_rtx (PLUS, Pmode,
-             gen_rtx (MULT, Pmode, index,
-                      GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
-             gen_rtx (LABEL_REF, Pmode, table_label)));
+  index = gen_rtx (PLUS, Pmode,
+                  gen_rtx (MULT, Pmode, index,
+                           GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
+                  gen_rtx (LABEL_REF, Pmode, table_label));
+#ifdef PIC_CASE_VECTOR_ADDRESS
+  if (flag_pic)
+    index = PIC_CASE_VECTOR_ADDRESS (index);
+  else
+#endif
+    index = memory_address_noforce (CASE_VECTOR_MODE, index);
   temp = gen_reg_rtx (CASE_VECTOR_MODE);
   vector = gen_rtx (MEM, CASE_VECTOR_MODE, index);
   RTX_UNCHANGING_P (vector) = 1;