Skip to content

Commit 208fd77

Browse files
author
hjl
committed
Don't check ix86_indirect_branch_register for GOT operand
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256714 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent 7fe7c88 commit 208fd77

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

gcc/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2018-01-15 H.J. Lu <[email protected]>
2+
3+
* config/i386/constraints.md (Bs): Update
4+
ix86_indirect_branch_register check. Don't check
5+
ix86_indirect_branch_register with GOT_memory_operand.
6+
(Bw): Likewise.
7+
* config/i386/predicates.md (GOT_memory_operand): Don't check
8+
ix86_indirect_branch_register here.
9+
(GOT32_symbol_operand): Likewise.
10+
111
2018-01-15 H.J. Lu <[email protected]>
212

313
* config/i386/predicates.md (constant_call_address_operand):

gcc/config/i386/constraints.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,18 @@
225225

226226
(define_constraint "Bs"
227227
"@internal Sibcall memory operand."
228-
(ior (and (not (match_test "TARGET_X32
229-
|| ix86_indirect_branch_register"))
228+
(ior (and (not (match_test "ix86_indirect_branch_register"))
229+
(not (match_test "TARGET_X32"))
230230
(match_operand 0 "sibcall_memory_operand"))
231-
(and (match_test "TARGET_X32 && Pmode == DImode
232-
&& !ix86_indirect_branch_register")
231+
(and (match_test "TARGET_X32 && Pmode == DImode")
233232
(match_operand 0 "GOT_memory_operand"))))
234233

235234
(define_constraint "Bw"
236235
"@internal Call memory operand."
237-
(ior (and (not (match_test "TARGET_X32
238-
|| ix86_indirect_branch_register"))
236+
(ior (and (not (match_test "ix86_indirect_branch_register"))
237+
(not (match_test "TARGET_X32"))
239238
(match_operand 0 "memory_operand"))
240-
(and (match_test "TARGET_X32 && Pmode == DImode
241-
&& !ix86_indirect_branch_register")
239+
(and (match_test "TARGET_X32 && Pmode == DImode")
242240
(match_operand 0 "GOT_memory_operand"))))
243241

244242
(define_constraint "Bz"

gcc/config/i386/predicates.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,7 @@
695695

696696
;; Return true if OP is a GOT memory operand.
697697
(define_predicate "GOT_memory_operand"
698-
(and (match_test "!ix86_indirect_branch_register")
699-
(match_operand 0 "memory_operand"))
698+
(match_operand 0 "memory_operand")
700699
{
701700
op = XEXP (op, 0);
702701
return (GET_CODE (op) == CONST
@@ -729,8 +728,7 @@
729728

730729
;; Return true if OP is a 32-bit GOT symbol operand.
731730
(define_predicate "GOT32_symbol_operand"
732-
(match_test "!ix86_indirect_branch_register
733-
&& GET_CODE (op) == CONST
731+
(match_test "GET_CODE (op) == CONST
734732
&& GET_CODE (XEXP (op, 0)) == UNSPEC
735733
&& XINT (XEXP (op, 0), 1) == UNSPEC_GOT"))
736734

0 commit comments

Comments
 (0)