]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/64833 ([SH]: Error: pcrel too far when compiling imagemagick and graphic...
authorKaz Kojima <kkojima@gcc.gnu.org>
Wed, 1 Jul 2015 22:05:09 +0000 (22:05 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Wed, 1 Jul 2015 22:05:09 +0000 (22:05 +0000)
PR target/64833
* [SH] Set length of casesi_worker_1 insn to 8 when flag_pic is set.

From-SVN: r225283

gcc/ChangeLog
gcc/config/sh/sh.md

index 7d1bc628bb2dfc29d7e707d5f9805277299b0ea0..bc1b8fa6f9b15339ff677f946504267156f691f2 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-01  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       Backport from mainline
+       2015-06-30  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/64833
+       * config/sh/sh.md (casesi_worker_1): Set length to 8 when
+       flag_pic is set.
+
 2015-07-01  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        Backport from mainline
index 6b1cf12010ed49c6c42e5670fbc52091b86a8db9..382540156d750903d8cc4720b79c433ed71e070f 100644 (file)
@@ -10750,6 +10750,8 @@ label:
     LABEL_NUSES (operands[2])++;
 })
 
+;; This may be replaced with casesi_worker_2 in sh_reorg for PIC.
+;; The insn length is set to 8 for that case.
 (define_insn "casesi_worker_1"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
        (unspec:SI [(reg:SI R0_REG)
@@ -10781,7 +10783,9 @@ label:
       gcc_unreachable ();
     }
 }
-  [(set_attr "length" "4")])
+  [(set_attr_alternative "length"
+     [(if_then_else (match_test "flag_pic") (const_int 8) (const_int 4))
+      (if_then_else (match_test "flag_pic") (const_int 8) (const_int 4))])])
 
 (define_insn "casesi_worker_2"
   [(set (match_operand:SI 0 "register_operand" "=r,r")