Don't check ix86_indirect_branch_register for GOT operand
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 15 Jan 2018 22:35:36 +0000 (22:35 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 15 Jan 2018 22:35:36 +0000 (14:35 -0800)
Since GOT_memory_operand and GOT32_symbol_operand are simple pattern
matches, don't check ix86_indirect_branch_register here.  If needed,
-mindirect-branch= will convert indirect branch via GOT slot to a call
and return thunk.

* config/i386/constraints.md (Bs): Update
ix86_indirect_branch_register check.  Don't check
ix86_indirect_branch_register with GOT_memory_operand.
(Bw): Likewise.
* config/i386/predicates.md (GOT_memory_operand): Don't check
ix86_indirect_branch_register here.
(GOT32_symbol_operand): Likewise.

From-SVN: r256714

gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/predicates.md

index 44de6022d05481641af09693ca938f4ceef70053..f89575a4c8481233aaf12adf107453d50b4f69d5 100644 (file)
@@ -1,3 +1,13 @@
+2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/i386/constraints.md (Bs): Update
+       ix86_indirect_branch_register check.  Don't check
+       ix86_indirect_branch_register with GOT_memory_operand.
+       (Bw): Likewise.
+       * config/i386/predicates.md (GOT_memory_operand): Don't check
+       ix86_indirect_branch_register here.
+       (GOT32_symbol_operand): Likewise.
+
 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/predicates.md (constant_call_address_operand):
index d6072b9bcd9dcb60837fc8f6b347ab7b7e6896f8..664e906b311e3a168f99bc22c7733980ae0e297f 100644 (file)
 
 (define_constraint "Bs"
   "@internal Sibcall memory operand."
-  (ior (and (not (match_test "TARGET_X32
-                             || ix86_indirect_branch_register"))
+  (ior (and (not (match_test "ix86_indirect_branch_register"))
+           (not (match_test "TARGET_X32"))
            (match_operand 0 "sibcall_memory_operand"))
-       (and (match_test "TARGET_X32 && Pmode == DImode
-                        && !ix86_indirect_branch_register")
+       (and (match_test "TARGET_X32 && Pmode == DImode")
            (match_operand 0 "GOT_memory_operand"))))
 
 (define_constraint "Bw"
   "@internal Call memory operand."
-  (ior (and (not (match_test "TARGET_X32
-                             || ix86_indirect_branch_register"))
+  (ior (and (not (match_test "ix86_indirect_branch_register"))
+           (not (match_test "TARGET_X32"))
            (match_operand 0 "memory_operand"))
-       (and (match_test "TARGET_X32 && Pmode == DImode
-                        && !ix86_indirect_branch_register")
+       (and (match_test "TARGET_X32 && Pmode == DImode")
            (match_operand 0 "GOT_memory_operand"))))
 
 (define_constraint "Bz"
index 6ec7ff2e784f4c9952ecd101b5d57ee157b31df0..a502657f9e30ec659ac4d39858a2c8816dc2f910 100644 (file)
 
 ;; Return true if OP is a GOT memory operand.
 (define_predicate "GOT_memory_operand"
-  (and (match_test "!ix86_indirect_branch_register")
-       (match_operand 0 "memory_operand"))
+  (match_operand 0 "memory_operand")
 {
   op = XEXP (op, 0);
   return (GET_CODE (op) == CONST
 
 ;; Return true if OP is a 32-bit GOT symbol operand.
 (define_predicate "GOT32_symbol_operand"
-  (match_test "!ix86_indirect_branch_register
-              && GET_CODE (op) == CONST
+  (match_test "GET_CODE (op) == CONST
                && GET_CODE (XEXP (op, 0)) == UNSPEC
                && XINT (XEXP (op, 0), 1) == UNSPEC_GOT"))