x86: Add -mindirect-branch-register
authorH.J. Lu <hongjiu.lu@intel.com>
Sun, 14 Jan 2018 14:40:01 +0000 (14:40 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sun, 14 Jan 2018 14:40:01 +0000 (06:40 -0800)
Add -mindirect-branch-register to force indirect branch via register.
This is implemented by disabling patterns of indirect branch via memory,
similar to TARGET_X32.

-mindirect-branch= and -mfunction-return= tests are updated with
-mno-indirect-branch-register to avoid false test failures when
-mindirect-branch-register is added to RUNTESTFLAGS for "make check".

gcc/

* config/i386/constraints.md (Bs): Disallow memory operand for
-mindirect-branch-register.
(Bw): Likewise.
* config/i386/predicates.md (indirect_branch_operand): Likewise.
(GOT_memory_operand): Likewise.
(call_insn_operand): Likewise.
(sibcall_insn_operand): Likewise.
(GOT32_symbol_operand): Likewise.
* config/i386/i386.md (indirect_jump): Call convert_memory_address
for -mindirect-branch-register.
(tablejump): Likewise.
(*sibcall_memory): Likewise.
(*sibcall_value_memory): Likewise.
Disallow peepholes of indirect call and jump via memory for
-mindirect-branch-register.
(*call_pop): Replace m with Bw.
(*call_value_pop): Likewise.
(*sibcall_pop_memory): Replace m with Bs.
* config/i386/i386.opt (mindirect-branch-register): New option.
* doc/invoke.texi: Document -mindirect-branch-register option.

gcc/testsuite/

* gcc.target/i386/indirect-thunk-1.c (dg-options): Add
-mno-indirect-branch-register.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-5.c: Likewise.
* gcc.target/i386/indirect-thunk-6.c: Likewise.
* gcc.target/i386/indirect-thunk-7.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
* gcc.target/i386/ret-thunk-10.c: Likewise.
* gcc.target/i386/ret-thunk-11.c: Likewise.
* gcc.target/i386/ret-thunk-12.c: Likewise.
* gcc.target/i386/ret-thunk-13.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.
* gcc.target/i386/indirect-thunk-register-1.c: New test.
* gcc.target/i386/indirect-thunk-register-2.c: Likewise.
* gcc.target/i386/indirect-thunk-register-3.c: Likewise.

From-SVN: r256662

49 files changed:
gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/i386.md
gcc/config/i386/i386.opt
gcc/config/i386/predicates.md
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c
gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/ret-thunk-10.c
gcc/testsuite/gcc.target/i386/ret-thunk-11.c
gcc/testsuite/gcc.target/i386/ret-thunk-12.c
gcc/testsuite/gcc.target/i386/ret-thunk-13.c
gcc/testsuite/gcc.target/i386/ret-thunk-14.c
gcc/testsuite/gcc.target/i386/ret-thunk-15.c
gcc/testsuite/gcc.target/i386/ret-thunk-9.c

index bd26df0b457b748cf5a4ccade0c01c086b7da18d..2fb1c5a8adfd09b4b66e8410d5e40a16d48f2ab3 100644 (file)
@@ -1,3 +1,26 @@
+2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/i386/constraints.md (Bs): Disallow memory operand for
+       -mindirect-branch-register.
+       (Bw): Likewise.
+       * config/i386/predicates.md (indirect_branch_operand): Likewise.
+       (GOT_memory_operand): Likewise.
+       (call_insn_operand): Likewise.
+       (sibcall_insn_operand): Likewise.
+       (GOT32_symbol_operand): Likewise.
+       * config/i386/i386.md (indirect_jump): Call convert_memory_address
+       for -mindirect-branch-register.
+       (tablejump): Likewise.
+       (*sibcall_memory): Likewise.
+       (*sibcall_value_memory): Likewise.
+       Disallow peepholes of indirect call and jump via memory for
+       -mindirect-branch-register.
+       (*call_pop): Replace m with Bw.
+       (*call_value_pop): Likewise.
+       (*sibcall_pop_memory): Replace m with Bs.
+       * config/i386/i386.opt (mindirect-branch-register): New option.
+       * doc/invoke.texi: Document -mindirect-branch-register option.
+
 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386-protos.h (ix86_output_function_return): New.
index 5f6c6d65332f64b1b1f44f8b289b6c6f6ba5a948..5592c43073e5757019f64ea9531188b04e21bb26 100644 (file)
 
 (define_constraint "Bs"
   "@internal Sibcall memory operand."
-  (ior (and (not (match_test "TARGET_X32"))
+  (ior (and (not (match_test "TARGET_X32
+                             || ix86_indirect_branch_thunk_register"))
            (match_operand 0 "sibcall_memory_operand"))
-       (and (match_test "TARGET_X32 && Pmode == DImode")
+       (and (match_test "TARGET_X32 && Pmode == DImode
+                        && !ix86_indirect_branch_thunk_register")
            (match_operand 0 "GOT_memory_operand"))))
 
 (define_constraint "Bw"
   "@internal Call memory operand."
-  (ior (and (not (match_test "TARGET_X32"))
+  (ior (and (not (match_test "TARGET_X32
+                             || ix86_indirect_branch_thunk_register"))
            (match_operand 0 "memory_operand"))
-       (and (match_test "TARGET_X32 && Pmode == DImode")
+       (and (match_test "TARGET_X32 && Pmode == DImode
+                        && !ix86_indirect_branch_thunk_register")
            (match_operand 0 "GOT_memory_operand"))))
 
 (define_constraint "Bz"
index 7e21c486d1951561c9723c187be8d7acafa74f93..fff73fe18e03e39a498a367785789c2b5a2e82d6 100644 (file)
   [(set (pc) (match_operand 0 "indirect_branch_operand"))]
   ""
 {
-  if (TARGET_X32)
+  if (TARGET_X32 || ix86_indirect_branch_thunk_register)
     operands[0] = convert_memory_address (word_mode, operands[0]);
   cfun->machine->has_local_indirect_jump = true;
 })
                                         OPTAB_DIRECT);
     }
 
-  if (TARGET_X32)
+  if (TARGET_X32 || ix86_indirect_branch_thunk_register)
     operands[0] = convert_memory_address (word_mode, operands[0]);
   cfun->machine->has_local_indirect_jump = true;
 })
   [(call (mem:QI (match_operand:W 0 "memory_operand" "m"))
         (match_operand 1))
    (unspec [(const_int 0)] UNSPEC_PEEPSIB)]
-  "!TARGET_X32"
+  "!TARGET_X32 && !ix86_indirect_branch_thunk_register"
   "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])
 
        (match_operand:W 1 "memory_operand"))
    (call (mem:QI (match_dup 0))
         (match_operand 3))]
-  "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (1))
+  "!TARGET_X32
+   && !ix86_indirect_branch_thunk_register
+   && SIBLING_CALL_P (peep2_next_insn (1))
    && !reg_mentioned_p (operands[0],
                        CALL_INSN_FUNCTION_USAGE (peep2_next_insn (1)))"
   [(parallel [(call (mem:QI (match_dup 1))
    (unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
    (call (mem:QI (match_dup 0))
         (match_operand 3))]
-  "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (2))
+  "!TARGET_X32
+   && !ix86_indirect_branch_thunk_register
+   && SIBLING_CALL_P (peep2_next_insn (2))
    && !reg_mentioned_p (operands[0],
                        CALL_INSN_FUNCTION_USAGE (peep2_next_insn (2)))"
   [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
 })
 
 (define_insn "*call_pop"
-  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lmBz"))
+  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lBwBz"))
         (match_operand 1))
    (set (reg:SI SP_REG)
        (plus:SI (reg:SI SP_REG)
   [(set_attr "type" "call")])
 
 (define_insn "*sibcall_pop_memory"
-  [(call (mem:QI (match_operand:SI 0 "memory_operand" "m"))
+  [(call (mem:QI (match_operand:SI 0 "memory_operand" "Bs"))
         (match_operand 1))
    (set (reg:SI SP_REG)
        (plus:SI (reg:SI SP_REG)
   [(set (match_operand:W 0 "register_operand")
         (match_operand:W 1 "memory_operand"))
    (set (pc) (match_dup 0))]
-  "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])"
+  "!TARGET_X32
+   && !ix86_indirect_branch_thunk_register
+   && peep2_reg_dead_p (2, operands[0])"
   [(set (pc) (match_dup 1))])
 
 ;; Call subroutine, returning value in operand 0
        (call (mem:QI (match_operand:W 1 "memory_operand" "m"))
              (match_operand 2)))
    (unspec [(const_int 0)] UNSPEC_PEEPSIB)]
-  "!TARGET_X32"
+  "!TARGET_X32 && !ix86_indirect_branch_thunk_register"
   "* return ix86_output_call_insn (insn, operands[1]);"
   [(set_attr "type" "callv")])
 
    (set (match_operand 2)
    (call (mem:QI (match_dup 0))
                 (match_operand 3)))]
-  "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (1))
+  "!TARGET_X32
+   && !ix86_indirect_branch_thunk_register
+   && SIBLING_CALL_P (peep2_next_insn (1))
    && !reg_mentioned_p (operands[0],
                        CALL_INSN_FUNCTION_USAGE (peep2_next_insn (1)))"
   [(parallel [(set (match_dup 2)
    (set (match_operand 2)
        (call (mem:QI (match_dup 0))
              (match_operand 3)))]
-  "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (2))
+  "!TARGET_X32
+   && !ix86_indirect_branch_thunk_register
+   && SIBLING_CALL_P (peep2_next_insn (2))
    && !reg_mentioned_p (operands[0],
                        CALL_INSN_FUNCTION_USAGE (peep2_next_insn (2)))"
   [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
 
 (define_insn "*call_value_pop"
   [(set (match_operand 0)
-       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lmBz"))
+       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lBwBz"))
              (match_operand 2)))
    (set (reg:SI SP_REG)
        (plus:SI (reg:SI SP_REG)
index 7b17773592b5a7a998a94d80074acd4a295cfd9e..c6be5f94773386fe589b636f9eed9d0e027973c9 100644 (file)
@@ -1045,3 +1045,7 @@ Enum(indirect_branch) String(thunk-inline) Value(indirect_branch_thunk_inline)
 
 EnumValue
 Enum(indirect_branch) String(thunk-extern) Value(indirect_branch_thunk_extern)
+
+mindirect-branch-register
+Target Report Var(ix86_indirect_branch_thunk_register) Init(0)
+Force indirect call and jump via register.
index 6fb2b4daf67a201f5b08542112d281993614ea02..5ae443231b83893176cace0f70013672e0530cbe 100644 (file)
 ;; Test for a valid operand for indirect branch.
 (define_predicate "indirect_branch_operand"
   (ior (match_operand 0 "register_operand")
-       (and (not (match_test "TARGET_X32"))
+       (and (not (match_test "TARGET_X32
+                             || ix86_indirect_branch_thunk_register"))
            (match_operand 0 "memory_operand"))))
 
 ;; Return true if OP is a memory operands that can be used in sibcalls.
 
 ;; Return true if OP is a GOT memory operand.
 (define_predicate "GOT_memory_operand"
-  (match_operand 0 "memory_operand")
+  (and (match_test "!ix86_indirect_branch_thunk_register")
+       (match_operand 0 "memory_operand"))
 {
   op = XEXP (op, 0);
   return (GET_CODE (op) == CONST
   (ior (match_test "constant_call_address_operand
                     (op, mode == VOIDmode ? mode : Pmode)")
        (match_operand 0 "call_register_no_elim_operand")
-       (ior (and (not (match_test "TARGET_X32"))
+       (ior (and (not (match_test "TARGET_X32
+                                  || ix86_indirect_branch_thunk_register"))
                 (match_operand 0 "memory_operand"))
-           (and (match_test "TARGET_X32 && Pmode == DImode")
+           (and (match_test "TARGET_X32 && Pmode == DImode
+                             && !ix86_indirect_branch_thunk_register")
                 (match_operand 0 "GOT_memory_operand")))))
 
 ;; Similarly, but for tail calls, in which we cannot allow memory references.
   (ior (match_test "constant_call_address_operand
                     (op, mode == VOIDmode ? mode : Pmode)")
        (match_operand 0 "register_no_elim_operand")
-       (ior (and (not (match_test "TARGET_X32"))
+       (ior (and (not (match_test "TARGET_X32
+                                  || ix86_indirect_branch_thunk_register"))
                 (match_operand 0 "sibcall_memory_operand"))
-           (and (match_test "TARGET_X32 && Pmode == DImode")
+           (and (match_test "TARGET_X32 && Pmode == DImode
+                             && !ix86_indirect_branch_thunk_register")
                 (match_operand 0 "GOT_memory_operand")))))
 
 ;; Return true if OP is a 32-bit GOT symbol operand.
 (define_predicate "GOT32_symbol_operand"
-  (match_test "GET_CODE (op) == CONST
+  (match_test "!ix86_indirect_branch_thunk_register
+              && GET_CODE (op) == CONST
                && GET_CODE (XEXP (op, 0)) == UNSPEC
                && XINT (XEXP (op, 0), 1) == UNSPEC_GOT"))
 
index 128a5620dc590d46867538f9d5ef8c55dbdc9a4d..cb18a0ebdf1a2bc683e9a6823c9862e08cd0ed02 100644 (file)
@@ -1230,7 +1230,8 @@ See RS/6000 and PowerPC Options.
 -mstack-protector-guard-offset=@var{offset} @gol
 -mstack-protector-guard-symbol=@var{symbol} -mmitigate-rop @gol
 -mgeneral-regs-only -mcall-ms2sysv-xlogues @gol
--mindirect-branch=@var{choice} -mfunction-return==@var{choice}}
+-mindirect-branch=@var{choice} -mfunction-return==@var{choice} @gol
+-mindirect-branch-register}
 
 @emph{x86 Windows Options}
 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
@@ -26868,6 +26869,10 @@ object file.  You can control this behavior for a specific function by
 using the function attribute @code{function_return}.
 @xref{Function Attributes}.
 
+@item -mindirect-branch-register
+@opindex -mindirect-branch-register
+Force indirect call and jump via register.
+
 @end table
 
 These @samp{-m} switches are supported in addition to the above
index 720c198c4eaa330231309608cebe422108e12644..796a32981101dba58c8ae15ba1de698b2c47785a 100644 (file)
@@ -1,3 +1,49 @@
+2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gcc.target/i386/indirect-thunk-1.c (dg-options): Add
+       -mno-indirect-branch-register.
+       * gcc.target/i386/indirect-thunk-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-5.c: Likewise.
+       * gcc.target/i386/indirect-thunk-6.c: Likewise.
+       * gcc.target/i386/indirect-thunk-7.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
+       * gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
+       * gcc.target/i386/ret-thunk-10.c: Likewise.
+       * gcc.target/i386/ret-thunk-11.c: Likewise.
+       * gcc.target/i386/ret-thunk-12.c: Likewise.
+       * gcc.target/i386/ret-thunk-13.c: Likewise.
+       * gcc.target/i386/ret-thunk-14.c: Likewise.
+       * gcc.target/i386/ret-thunk-15.c: Likewise.
+       * gcc.target/i386/ret-thunk-9.c: Likewise.
+       * gcc.target/i386/indirect-thunk-register-1.c: New test.
+       * gcc.target/i386/indirect-thunk-register-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-register-3.c: Likewise.
+
 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/indirect-thunk-1.c (dg-options): Add
index f076155c91aa2d36ee45875cb3cff012e41502e9..9eb9b273ade640ccbd99670bb5f0f7f5225f0c3d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index d7984f592fee4998802e51b5ea8b586759873658..c63795e41278ed11b1a0c4c6a1f2149ab44e9d28 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 3257d0a2e16203d22ffebe5a1465d83b96d2d80a..82973cda7719329aceeb680e943ffd009a612f96 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 7cab2df6474cf2a4f07e85e678a0ff19f407ca90..a5f3d1cbed8941795421c575b84ec0386a719a7a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index b4836c38d6c9e471dfd77ae9132febf9012ab80e..fcaa18d10b7fd36402b691be7175e1c2660d4dfb 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
 
 extern void bar (void);
 
index 1f06bd1af7412ef1ae16d08ada9d33e2dbb28fbf..e4649283d100df2aadb65e4e2c90612cf1041861 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
 
 extern void bar (void);
 
index 0b3fef86a20b40b0e43ee3ec618f9826a2e5b0ff..ebfb8aab9373310bb91a3ff074c04afae0889700 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 void func0 (void);
 void func1 (void);
index 5f6cfc17b56221939e09d15d5c4d8c3eef6e94e8..a08022db8e4295bdf097e19478c2904ebaa0e44f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index b256160ec80f1ae2a8861aff015a371b18183f8d..b257c695ad16af63d27013071c8551e7b4cd78d5 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 567c95051d6a4280262a1d232040cf387fd377c6..dfb1370d23d7c04061c941e5ea7ba0dc29f40e6f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 3b662af7d5dff9ccb7def8ca4495fd24fecccb3e..a6e3f6f9f2b1612202a492222b2d5e540050462a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 98785a382481e8de3188a27f76ccd7e79498b75d..4bb1c5f9220fc84b466c95a733327cabe626dd07 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index a498a39e404714e38a2b3b6cf1662d6a04514674..4e33a6388629ccaf232bb59bf1853aea58ffda09 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 66f295d1eb6d6c2037a68fa6cd4a46f52af7113d..427ba3ddbb4144c7ceda59bcf78e62af8899a421 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
 
 void func0 (void);
 void func1 (void);
index aacb814d737feb5dd5fd6e8fc137f6e63944f99f..dc7143414fb451cf84f12ee5325ebcf67539e0b7 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
 
 void (*dispatch) (char *);
 char buf[10];
index 7b44dda23df286d45b7593da6caeda0d061c7358..737c60946f6da773159cdb88ca2999b29eeab26e 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { ! x32 } } } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
 
 void (*dispatch) (char *);
 char buf[10];
index 70b4fb36eeace1a238f26c566eddd1a077f3a25b..d34485a00108cc91d9de91e1cdc458ff81c04fa4 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { *-*-linux* && { ! x32 } } } } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
 
 void bar (char *);
 char buf[10];
index 3baf03ee77cb1ef8530175571fdb7dafe5e655a0..0e19830de4dc53d94f40bfacb364a463001307ec 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { *-*-linux* && { ! x32 } } } } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
 
 void bar (char *);
 char buf[10];
index 637fc3d3f4e356d27090d3a1986be163f0cf2bf8..5c20a35ecece1bb929bbd224aa4f8646d4641c42 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index ff9efe03fe67a1c4a9a7632463023929dffce6ff..b2fb6e1bcd27130590cde8e2736139497d2fec5d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 2686a5f2db404a4ce2210e7db1d0a6e2a2b02c03..9c84547cd7c8d0c325f41f173465da7ec1897c9b 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index f07f6b214ad0b417d1ea9908c06c4444634f16a6..457849564bb86c1ead5e1444ce78af25eada570c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 21740ac5b7f4ec5b22508c61b1e0d2671f9d8002..5c07e02df6ac0cababbdeba2d69cebf49ab22500 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
 
 extern void bar (void);
 
index a77c1f470b80cc0827bb7db711a7536e4a9728d8..3eb440693a0a9d93a114c3c421b992d33759ae1c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
 
 extern void bar (void);
 
index e64910fd4aaf20ed7672ebfa267e6a5b02a40eca..d4747ea0764fa80fbcb6e702f4701609e8d707e0 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 void func0 (void);
 void func1 (void);
index 365cf2ee22637f1906c42947828096812924244d..536abfa74e40e42ae086a0531640ac9f668c5817 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 72646a4960b463a6bec11db3901c73ac21ae89d0..bd2b6246aa16c95c6099a23acb53b05fdc66e4db 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index f48945e3dfcea5b283713ae6d68e38a81c4718e9..9885eebbcfff0338f6de7b57862fef215bc24502 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 4b1d558fc4e71e47a64865f2e43da0f5ef9c1405..7b3983949d2243edf3ce4142ecc6de177e4da140 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 typedef void (*dispatch_t)(long offset);
 
index 0f687c3b02762b5e2683f419f45b4f26412002da..c6d77e10352fd503b86ce0e3240fe30bbbac0047 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
 
 extern void bar (void);
 
index b27c6fc96a2a8f1bd2561b083db5668bf3abbe82..6454827b780da4b97134b01c14539be9ac73d341 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target *-*-linux* } } */
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
 
 extern void bar (void);
 
index 2c496492eaaf7ab158ae85fe23310566c45365e9..cc592f89aba831114e7a98b11259f62a813a5d86 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 void func0 (void);
 void func1 (void);
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c
new file mode 100644 (file)
index 0000000..7d396a3
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mindirect-branch=thunk -mindirect-branch-register -fno-pic" } */
+
+typedef void (*dispatch_t)(long offset);
+
+dispatch_t dispatch;
+
+void
+male_indirect_jump (long offset)
+{
+  dispatch(offset);
+}
+
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
+/* { dg-final { scan-assembler "mov\[ \t\](%eax|%rax), \\((%esp|%rsp)\\)" } } */
+/* { dg-final { scan-assembler {\tpause} } } */
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch"  } } */
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk\n" } } */
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk_bnd\n" } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c
new file mode 100644 (file)
index 0000000..e7e616b
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mindirect-branch=thunk-inline -mindirect-branch-register -fno-pic" } */
+
+typedef void (*dispatch_t)(long offset);
+
+dispatch_t dispatch;
+
+void
+male_indirect_jump (long offset)
+{
+  dispatch(offset);
+}
+
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
+/* { dg-final { scan-assembler "mov\[ \t\](%eax|%rax), \\((%esp|%rsp)\\)" } } */
+/* { dg-final { scan-assembler {\tpause} } } */
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch"  } } */
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c
new file mode 100644 (file)
index 0000000..5320e92
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mindirect-branch=thunk-extern -mindirect-branch-register -fno-pic" } */
+
+typedef void (*dispatch_t)(long offset);
+
+dispatch_t dispatch;
+
+void
+male_indirect_jump (long offset)
+{
+  dispatch(offset);
+}
+
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch"  } } */
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
+/* { dg-final { scan-assembler-not {\t(pause|pause|nop)} } } */
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */
+/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */
index 1630e2fa2b5bd18a26eea6b366bc2b450889b4c2..b4f9d48065d8f5d928c3d95ec7c22325f1ff740e 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */
 
 extern void (*bar) (void);
 
index 876159cf7837022d779c88d6d3f753a2550872c3..0312577a043b3a62e8c0fb7a16fb81f642194139 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */
 
 extern void (*bar) (void);
 
index 01b0a02f80b018d6d230d2b1fe6f9b23105603f2..fa3181303c9617e01338491d65f16b8298520f8f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
 
 extern void (*bar) (void);
 
index e028c2b6a9939cf3ce1e4efab617939c6f55358a..7a08e71c76bde1169177d7a7d0b770b05cf03a8f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
 
 extern void (*bar) (void);
 extern int foo (void) __attribute__ ((function_return("thunk")));
index c14ee3ae4c08bae643a082fab2ee37858e726263..dacf0c769fc03e2182232831fd5c78377e8ad6a6 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
 
 extern void (*bar) (void);
 
index 2f21e138ec290970cd62cdb817e08918325799ff..cf06a5f35c72a602d64a943a3befa02f77cff033 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */
 
 extern void (*bar) (void);
 
index f6ccad98da7a286919cb8d6f9406b1b68557e5aa..6da5ab97081cccfbcc39626b5f6aa97709fee0b5 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */
 
 extern void (*bar) (void);