diff options
author | gccadmin <gccadmin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2019-10-17 00:16:05 +0000 |
---|---|---|
committer | gccadmin <gccadmin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2019-10-17 00:16:05 +0000 |
commit | cb73f7448091806286514e3a251f358b60053a82 (patch) | |
tree | 88cbcc563369204fc3fb15ad0675a8103de9609b | |
parent | 4f81768e3acf1633764b2a3a1c69551d3dee966c (diff) |
Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@277085 138bc75d-0d04-0410-961f-82ee72b054a4
81 files changed, 957 insertions, 497 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8631f0a94e9..21f39d74b7d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,111 @@ +2019-10-16 Peter Bergner <bergner@linux.ibm.com> + + Backport from mainline + 2019-10-08 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> + + * config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and + LINK_OS_EXTRA_SPEC64 to MD_STARTFILE_PREFIX and + MD_STARTFILE_PREFIX_1 when using --with-advance-toolchain. + +2019-10-11 Oleg Endo <olegendo@gcc.gnu.org> + + Backport from mainline + 2019-10-10 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/88630 + * config/sh/sh.h (TARGET_FPU_SH4_300): New macro. + * config/sh/sh.c (sh_option_override): Enable fsca and fsrra insns + also for TARGET_FPU_SH4_300. + (sh_emit_mode_set): Check for TARGET_FPU_SH4_300 instead of + TARGET_SH4_300. + * config/sh/sh.md (toggle_pr): Add TARGET_FPU_SH4_300 condition. + (negsf2): Expand to either negsf2_fpscr or negsf2_no_fpscr. + (*negsf2_i): Split into ... + (negsf2_fpscr, negsf2_no_fpscr): ... these new patterns. + (abssf2): Expand to either abssf2_fpsc or abssf2_no_fpsc. + (**abssf2_i): Split into ... + (abssf2_fpscr, abssf2_no_fpscr): ... these new patterns. + (negdf2): Expand to either negdf2_fpscr or negdf2_no_fpscr. + (*negdf2_i): Split into ... + (negdf2_fpscr, negdf2_no_fpscr): ... these new patterns. + (absdf2): Expand to either absdf2_fpscr or absdf2_no_fpsc. + (**abssf2_i): Split into ... + (absdf2_fpscr, absdf2_no_fpscr): ... these new patterns. + +2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com> + + Backport from mainline + 2019-10-01 Bill Schmidt <wschmidt@linux.ibm.com> + + PR target/91275 + * config/rs6000/rs6000.c (rtx_is_swappable_p): Don't swap + vpmsumd. + +2019-10-01 Oleg Endo <olegendo@gcc.gnu.org> + + Backport from mainline + + 2019-10-01 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/88562 + * config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use + sh_check_add_incdec_notes to preserve REG_INC notes when replacing + a memory access insn. + +2019-09-28 Iain Sandoe <iain@sandoe.co.uk> + + Backport from mainline. + 2019-05-12 Iain Sandoe <iain@sandoe.co.uk> + + PR target/82920 + * config/i386/darwin.h (CC1_SPEC): Report -mx32 as an error for + Darwin. + +2019-09-28 Iain Sandoe <iain@sandoe.co.uk> + + Backport from mainline. + 2019-05-12 Iain Sandoe <iain@sandoe.co.uk> + + PR target/82920 + * config/i386/i386.c (ix86_output_jmp_thunk_or_indirect): New. + (ix86_output_indirect_branch_via_reg): Use output mechanism + accounting for __USER_LABEL_PREFIX__. + (ix86_output_indirect_branch_via_push): Likewise. + (ix86_output_function_return): Likewise. + (ix86_output_indirect_function_return): Likewise. + +2019-09-28 Oleg Endo <olegendo@gcc.gnu.org> + + Backport from mainline + 2019-09-28 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/80672 + * config/sh/sh.c (parse_validate_atomic_model_option): Use + std::string::compare instead of std::string::find. + +2019-09-28 Oleg Endo <olegendo@gcc.gnu.org> + + Backport from mainline + 2018-07-15 Jeff Law <law@redhat.com> + + PR target/85993 + * config/sh/sh.c (output_mi_thunk): Remove dead conditional + block. + +2019-09-27 Iain Sandoe <iain@sandoe.co.uk> + + Backport from mainline + 2019-06-16 Iain Sandoe <iain@sandoe.co.uk> + + * config/darwin.opt (prebind, noprebind, seglinkedit, + noseglinkedit): Add RejectNegative. + + Backport from mainline + 2019-06-14 Iain Sandoe <iain@sandoe.co.uk> + + * config/darwin.opt: Add RejectNegative where needed, reorder + and add minimal functional descriptions. + 2019-09-23 Max Filippov <jcmvbkbc@gmail.com> Backport from mainline diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 1c14e6dbe55..6f145caa08d 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20190926 +20191017 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5c39dbc6328..14a5dbca52a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2019-10-12 Eric Botcazou <ebotcazou@adacore.com> + + PR ada/91995 + * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters. + * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters, + and adjust accordingly. + +2019-10-11 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the + sign of the value when deciding to build a NEGATE_EXPR. + <PLUS_EXPR>: Remove redundant line. + <BIT_AND_EXPR>: Do the negation here. + 2019-09-23 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 3a5126ad3da..eb337152bcc 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -8073,9 +8073,8 @@ annotate_value (tree gnu_size) { case INTEGER_CST: /* For negative values, build NEGATE_EXPR of the opposite. Such values - can appear for discriminants in expressions for variants. Note that - sizetype being unsigned, we don't directly use tree_int_cst_sgn. */ - if (tree_int_cst_sign_bit (gnu_size)) + can appear for discriminants in expressions for variants. */ + if (tree_int_cst_sgn (gnu_size) < 0) { tree t = wide_int_to_tree (sizetype, wi::neg (gnu_size)); tcode = Negate_Expr; @@ -8148,9 +8147,8 @@ annotate_value (tree gnu_size) && tree_int_cst_sign_bit (TREE_OPERAND (gnu_size, 1))) { tcode = Minus_Expr; - ops[0] = annotate_value (TREE_OPERAND (gnu_size, 0)); - wide_int op1 = wi::neg (TREE_OPERAND (gnu_size, 1)); - ops[1] = annotate_value (wide_int_to_tree (sizetype, op1)); + wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1)); + ops[1] = annotate_value (wide_int_to_tree (sizetype, wop1)); break; } @@ -8189,9 +8187,9 @@ annotate_value (tree gnu_size) Such values can appear in expressions with aligning patterns. */ if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST) { - wide_int op1 = wi::sext (TREE_OPERAND (gnu_size, 1), - TYPE_PRECISION (sizetype)); - ops[1] = annotate_value (wide_int_to_tree (sizetype, op1)); + wide_int wop1 = wi::neg (TREE_OPERAND (gnu_size, 1)); + tree op1 = wide_int_to_tree (sizetype, wop1); + ops[1] = annotate_value (build1 (NEGATE_EXPR, sizetype, op1)); } break; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 1a7b6ab92af..d461692807e 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -5203,10 +5203,7 @@ package body Sem_Util is -- Defining_Entity -- --------------------- - function Defining_Entity - (N : Node_Id; - Empty_On_Errors : Boolean := False) return Entity_Id - is + function Defining_Entity (N : Node_Id) return Entity_Id is Err : Entity_Id := Empty; begin @@ -5285,14 +5282,10 @@ package body Sem_Util is -- can continue semantic analysis. elsif Nam = Error then - if Empty_On_Errors then - return Empty; - else - Err := Make_Temporary (Sloc (N), 'T'); - Set_Defining_Unit_Name (N, Err); + Err := Make_Temporary (Sloc (N), 'T'); + Set_Defining_Unit_Name (N, Err); - return Err; - end if; + return Err; -- If not an entity, get defining identifier @@ -5307,11 +5300,7 @@ package body Sem_Util is return Entity (Identifier (N)); when others => - if Empty_On_Errors then - return Empty; - else - raise Program_Error; - end if; + raise Program_Error; end case; end Defining_Entity; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index cfec762dcb3..5a33d467083 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -474,9 +474,7 @@ package Sem_Util is -- in the case of a descendant of a generic formal type (returns Int'Last -- instead of 0). - function Defining_Entity - (N : Node_Id; - Empty_On_Errors : Boolean := False) return Entity_Id; + function Defining_Entity (N : Node_Id) return Entity_Id; -- Given a declaration N, returns the associated defining entity. If the -- declaration has a specification, the entity is obtained from the -- specification. If the declaration has a defining unit name, then the @@ -487,19 +485,6 @@ package Sem_Util is -- local entities declared during loop expansion. These entities need -- debugging information, generated through Qualify_Entity_Names, and -- the loop declaration must be placed in the table Name_Qualify_Units. - -- - -- Set flag Empty_On_Error to change the behavior of this routine as - -- follows: - -- - -- * True - A declaration that lacks a defining entity returns Empty. - -- A node that does not allow for a defining entity returns Empty. - -- - -- * False - A declaration that lacks a defining entity is given a new - -- internally generated entity which is subsequently returned. A node - -- that does not allow for a defining entity raises Program_Error. - -- - -- The former semantics is appropriate for the back end; the latter - -- semantics is appropriate for the front end. function Denotes_Discriminant (N : Node_Id; diff --git a/gcc/config.gcc b/gcc/config.gcc index 8f3a7bcbe87..1f8f680cb7d 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4332,14 +4332,12 @@ case "${target}" in echo "#undef LINK_OS_EXTRA_SPEC32" echo "#define LINK_OS_EXTRA_SPEC32" \ "\"%(link_os_new_dtags)" \ - "-rpath $prefix/lib -rpath $at/lib" \ - "-L $prefix/lib -L $at/lib\"" + "-rpath $prefix/lib -rpath $at/lib\"" echo echo "#undef LINK_OS_EXTRA_SPEC64" echo "#define LINK_OS_EXTRA_SPEC64" \ "\"%(link_os_new_dtags)" \ - "-rpath $prefix/lib64 -rpath $at/lib64" \ - "-L $prefix/lib64 -L $at/lib64\"" + "-rpath $prefix/lib64 -rpath $at/lib64\"" echo echo "#undef LINK_OS_NEW_DTAGS_SPEC" echo "#define LINK_OS_NEW_DTAGS_SPEC" \ @@ -4352,7 +4350,10 @@ case "${target}" in echo "#define MD_EXEC_PREFIX \"$at/bin/\"" echo echo "#undef MD_STARTFILE_PREFIX" - echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \ + echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\"" + echo + echo "#undef MD_STARTFILE_PREFIX_1" + echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \ > advance-toolchain.h else echo "Unknown advance-toolchain $with_advance_toolchain" diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt index 135a9c023cb..0df8fe4fc56 100644 --- a/gcc/config/darwin.opt +++ b/gcc/config/darwin.opt @@ -18,240 +18,378 @@ ; along with GCC; see the file COPYING3. If not see ; <http://www.gnu.org/licenses/>. -; Various linker options have a -Z added so that they can get to specs -; processing without interference. Note that an option name with a -; prefix that matches another option name, that also takes an -; argument, being mapped to a -Z linker option, needs to be modified -; so the prefix is different, otherwise a '*' after the shorter option -; will match with the longer one. +; We have a lot of Driver options, many of which are obsolete or very very +; rarely used so, to keep this file easier to manage: + +; Please place all Non-driver options first (in alphabetical order), followed +; by Driver-only options. + +; Non-driver options. + +dependency-file +C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs) + +fapple-kext +Target Report C++ Var(flag_apple_kext) +Generate code for darwin loadable kernel extensions. + +iframework +Target RejectNegative C ObjC C++ ObjC++ Joined Separate +-iframework <dir> Add <dir> to the end of the system framework include path. + +mconstant-cfstrings +Target Report Var(darwin_constant_cfstrings) Init(1) +Generate compile-time CFString objects. + +Wnonportable-cfstrings +Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning +Warn if constant CFString objects contain non-portable characters. + +; Use new-style pic stubs if this is true, x86 only so far. +matt-stubs +Target Report Var(darwin_macho_att_stub) Init(1) +Generate AT&T-style stubs for Mach-O. + +mdynamic-no-pic +Target Common Report Mask(MACHO_DYNAMIC_NO_PIC) +Generate code suitable for executables (NOT shared libs). + +mfix-and-continue +Target Report Var(darwin_fix_and_continue) +Generate code suitable for fast turn around debugging. + +mkernel +Target Report Var(flag_mkernel) +Generate code for the kernel or loadable kernel extensions. + +; The Init here is for the convenience of GCC developers, so that cc1 +; and cc1plus don't crash if no -mmacosx-version-min is passed. The +; driver will always pass a -mmacosx-version-min, so in normal use the +; Init is never used. +mmacosx-version-min= +Target RejectNegative Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION) +The earliest MacOS X version on which this program will run. + +; Really, only relevant to PowerPC which has a 4 byte bool by default. +mone-byte-bool +Target RejectNegative Report Var(darwin_one_byte_bool) +Set sizeof(bool) to 1. + +; Some code-gen may be improved / adjusted if the linker is sufficiently modern. +mtarget-linker= +Target RejectNegative Joined Report Alias(mtarget-linker) + +mtarget-linker +Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION) +The version of ld64 in use for this toolchain. + +; Driver options. all_load -Driver Alias(Zall_load) +Driver RejectNegative Alias(Zall_load) +Loads all members of archive libraries allowable_client -Driver Separate Alias(Zallowable_client) +Driver RejectNegative Separate Alias(Zallowable_client) +-allowable_client <name> The output dylib is private to the client(s) named arch Driver RejectNegative Separate +-arch <name> Specify that the output file should be generated for architecture \"name\" arch_errors_fatal -Driver Alias(Zarch_errors_fatal) +Driver RejectNegative Alias(Zarch_errors_fatal) +Mismatches between file architecture and the \"-arch\" are errors instead of warnings asm_macosx_version_min= Driver RejectNegative Joined +The earliest MacOS X version on which this program will run (formatted for the assembler) bind_at_load -Driver Alias(Zbind_at_load) +Driver RejectNegative Alias(Zbind_at_load) +Produce an output file that will bind symbols on load, rather than lazily. bundle -Driver Alias(Zbundle) +Driver RejectNegative Alias(Zbundle) +Produce a Mach-O bundle (file type MH_BUNDLE) bundle_loader -Driver Separate Alias(Zbundle_loader) +Driver RejectNegative Separate Alias(Zbundle_loader) +-bundle_loader <executable> Treat \"executable\" (that will be loading this bundle) as if it was one of the dynamic libraries the bundle is linked against for symbol resolution -dead_strip -Driver Alias(Zdead_strip) +client_name +Driver RejectNegative Separate +-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client) -dependency-file -C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs) +compatibility_version +Driver RejectNegative Separate +-compatibility_version <number> Set the minimum version for the client interface. Clients must record a greater number than this or the binding will fail at runtime + +current_version +Driver RejectNegative Separate +-current_version <number> Set the current version for the library. + +dead_strip +Driver RejectNegative Alias(Zdead_strip) +Remove code and data that is unreachable from any exported symbol (including the entry point) dylib_file Driver Separate Alias(Zdylib_file) dylinker -Driver +Driver RejectNegative +Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld. + +dylinker_install_name +Driver RejectNegative Separate +-dylinker_install_name <path> Only used for building dyld. dynamic -Driver Alias(Zdynamic) +Driver RejectNegative Alias(Zdynamic) +The default (and opposite of -static), implied by user mode executables, shared libraries and bundles. dynamiclib -Driver Alias(Zdynamiclib) +Driver RejectNegative Alias(Zdynamiclib) +Produce a Mach-O shared library (file type MH_DYLIB), synonym for -shared exported_symbols_list -Driver Separate Alias(Zexported_symbols_list) +Driver RejectNegative Separate Alias(Zexported_symbols_list) +-exported_symbols_list <filename> Global symbols in \"filename\" will be exported from the linked output file, any symbols not mentioned will be treated as hidden. filelist Driver RejectNegative Separate +Supply a list of objects to be linked from a file, rather than the command line findirect-virtual-calls Driver RejectNegative +Used for generating code for some older kernel revisions. flat_namespace Driver RejectNegative Alias(Zflat_namespace) +Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol. force_cpusubtype_ALL Driver RejectNegative Alias(Zforce_cpusubtype_ALL) +For the assembler (and linker) permit any architecture sub-variant to be used without error. force_flat_namespace Driver RejectNegative Alias(Zforce_flat_namespace) +Set the output object such that, on loading, dyld will ignore any two-level information and resolve symbols in the discovery order for loaded libs. framework Driver RejectNegative Separate +-framework <name> The linker should search for the named framework in the framework search path. fterminated-vtables Driver RejectNegative +Used for generating code for some older kernel revisions. gfull Driver +Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\" gused -Driver +Driver RejectNegative +Abbreviation for \"-g -feliminate-unused-debug-symbols\" headerpad_max_install_names -Driver +Driver RejectNegative +Automatically adds space for longer path names in load commands (up to MAXPATHLEN) image_base -Driver Separate Alias(Zimage_base) +Driver RejectNegative Separate Alias(Zimage_base) +-image_base <address> Choose a base address for a dylib or bundle. init -Driver Separate Alias(Zinit) +Driver RejectNegative Separate Alias(Zinit) +-init <symbol_name> The symbol \"symbol_name\" will be used as the first initialiser for a dylib. install_name -Driver Separate Alias(Zinstall_name) +Driver RejectNegative Separate Alias(Zinstall_name) +-install_name <name> Set the install name for a dylib. keep_private_externs -Driver - -mconstant-cfstrings -Target Report Var(darwin_constant_cfstrings) Init(1) -Generate compile-time CFString objects. +Driver RejectNegative +Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported. multi_module Driver RejectNegative Alias(Zmulti_module) +(Obsolete after 10.4) Multi modules are ignored at runtime since MacOS 10.4 multiply_defined Driver RejectNegative Separate Alias(Zmultiply_defined) +(Obsolete after 10.4) -multiply_defined <treatment> Provided a mechanism for warning about symbols defined in multiple dylibs. multiply_defined_unused Driver RejectNegative Separate Alias(Zmultiplydefinedunused) +(Obsolete after 10.4) -multiply_defined_unused <treatment> Provided a mechanism for warning about symbols defined in the current executable also being defined in linked dylibs. no_dead_strip_inits_and_terms -Driver Alias(Zno_dead_strip_inits_and_terms) +Driver RejectNegative Alias(Zno_dead_strip_inits_and_terms) +(Obsolete) The linker never dead strips these items, so the option is not needed. nofixprebinding -Driver +Driver RejectNegative +(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an exectuable. nomultidefs -Driver +Driver RejectNegative +(Obsolete after 10.4) Set MH_NOMULTIDEFS in an umbrella framework. noprebind -Driver +Driver RejectNegative Negative(prebind) +(Obsolete) LD_PREBIND is no longer supported. noseglinkedit -Driver +Driver RejectNegative Negative(seglinkedit) +(Obsolete) This is the default. object -Driver +Driver RejectNegative + +pagezero_size +Driver RejectNegative Separate +-pagezero_size size Allows setting the page 0 size to 4kb for certain special cases. prebind -Driver +Driver RejectNegative Negative(noprebind) +(Obsolete) LD_PREBIND is no longer supported. prebind_all_twolevel_modules -Driver +Driver RejectNegative +(Obsolete) LD_PREBIND is no longer supported. preload -Driver +Driver RejectNegative +Produces a Mach-O file suitable for embedded/ROM use. private_bundle -Driver +Driver RejectNegative +(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable. pthread -Driver +Driver RejectNegative rdynamic -Driver +Driver RejectNegative +Synonym for \"-export-dynamic\" for linker versions that support it. + +read_only_relocs +Driver RejectNegative Separate +-read_only_relocs <treatment> This will allow relocs in read-only pages (not advisable). + +sectalign +Driver RejectNegative Separate Args(3) +-sectalign <segname> <sectname> <value> Set section \"sectname\" in segment \"segname\" to have alignment \"value\" which must be an integral power of two expressed in hexadecimal form. + +sectcreate +Driver RejectNegative Separate Args(3) +-sectcreate <segname> <sectname> <file> Create section \"sectname\" in segment \"segname\" from the contents of \"file\". + +sectobjectsymbols +Driver RejectNegative Separate Args(2) +(Obsolete) -sectobjectsymbols <segname> <sectname> Setting a local symbol at the start of a section is no longer supported. + +sectorder +Driver RejectNegative Separate Args(3) +(Obsolete) -sectorder <segname> <sectname> orderfile Replaced by a more general option \"-order_file\". seg_addr_table -Driver Separate Alias(Zseg_addr_table) +Driver RejectNegative Separate Alias(Zseg_addr_table) +-seg_addr_table <file> Specify the base addresses for dynamic libraries, \"file\" contains a line for each library. +; This is only usable by the ld_classic linker. seg_addr_table_filename -Driver Separate Alias(Zfn_seg_addr_table_filename) +Driver RejectNegative Separate Alias(Zfn_seg_addr_table_filename) +(Obsolete, ld_classic only) -seg_addr_table_filename <path> + +seg1addr +Driver RejectNegative Separate +Synonym for \"image_base\" segaddr -Driver Separate Args(2) Alias(Zsegaddr) +Driver RejectNegative Separate Args(2) Alias(Zsegaddr) +-segaddr <name> <address> Set the base address of segment \"name\" to \"address\" which must be aligned to a page boundary (currently 4kb). + +; This is only usable by the ld_classic linker. +segcreate +Driver RejectNegative Separate Args(3) +(Obsolete, ld_classic only) -sectcreate segname sectname file seglinkedit -Driver +Driver RejectNegative Negative(noseglinkedit) +(Obsolete) Object files with LINKEDIT sections are no longer supported. + +segprot +Driver RejectNegative Separate Args(3) +-segprot <segname> max_prot init_prot The protection values are \"r\", \"w\", \"x\" or \"-\" the latter meaning \"no access\". segs_read_only_addr -Driver Separate Alias(Zsegs_read_only_addr) +Driver RejectNegative Separate Alias(Zsegs_read_only_addr) +-segs_read_only_addr address Allows specifying the address of the read only portion of a dylib. segs_read_write_addr -Driver Separate Alias(Zsegs_read_write_addr) +Driver RejectNegative Separate Alias(Zsegs_read_write_addr) +-segs_read_write_addr address Allows specifying the address of the read/write portion of a dylib. single_module -Driver Alias(Zsingle_module) +Driver RejectNegative Alias(Zsingle_module) +(Obsolete) This is the default. + +sub_library +Driver RejectNegative Separate +-sub_library <name> Library named \"name\" will be re-exported (only useful for dylibs). + +sub_umbrella +Driver RejectNegative Separate +-sub_umbrella <name> Framework named \"name\" will be re-exported (only useful for dylibs). twolevel_namespace -Driver +Driver RejectNegative +This is the default twolevel_namespace_hints -Driver +Driver RejectNegative +Specifies content that can speed up dynamic loading when the binaries are unchanged. umbrella -Driver Separate Alias(Zumbrella) +Driver RejectNegative Separate Alias(Zumbrella) +-umbrella <framework> The specified framework will be re-exported. + +undefined +Driver RejectNegative Separate +-undefined <treatment> Specify the handling for undefined symbols (default is error). unexported_symbols_list -Driver Separate Alias(Zunexported_symbols_list) +Driver RejectNegative Separate Alias(Zunexported_symbols_list) +-unexported_symbols_list <filename> Don't export global symbols listed in filename. weak_reference_mismatches -Driver Separate Alias(Zweak_reference_mismatches) +Driver RejectNegative Separate Alias(Zweak_reference_mismatches) +-weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak. whatsloaded -Driver +Driver RejectNegative +Logs the object files the linker loads whyload -Driver +Driver RejectNegative +Logs which symbol(s) caused an object to be loaded. + +;(Obsolete, ignored) Strip symbols starting with "L", this is the default. +X +Driver RejectNegative y -Driver Joined +Driver RejectNegative Joined +(Obsolete, ignored) Old support similar to whyload. Mach -Driver - -Wnonportable-cfstrings -Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning -Warn if constant CFString objects contain non-portable characters. - -; Use new-style pic stubs if this is true, x86 only so far. -matt-stubs -Target Report Var(darwin_macho_att_stub) Init(1) -Generate AT&T-style stubs for Mach-O. - -mdynamic-no-pic -Target Common Report Mask(MACHO_DYNAMIC_NO_PIC) -Generate code suitable for executables (NOT shared libs). - -mfix-and-continue -Target Report Var(darwin_fix_and_continue) -Generate code suitable for fast turn around debugging. - -; The Init here is for the convenience of GCC developers, so that cc1 -; and cc1plus don't crash if no -mmacosx-version-min is passed. The -; driver will always pass a -mmacosx-version-min, so in normal use the -; Init is never used. -mmacosx-version-min= -Target Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION) -The earliest MacOS X version on which this program will run. - -mone-byte-bool -Target RejectNegative Report Var(darwin_one_byte_bool) -Set sizeof(bool) to 1. - -fapple-kext -Target Report C++ Var(flag_apple_kext) -Generate code for darwin loadable kernel extensions. - -mkernel -Target Report Var(flag_mkernel) -Generate code for the kernel or loadable kernel extensions. - -iframework -Target RejectNegative C ObjC C++ ObjC++ Joined Separate --iframework <dir> Add <dir> to the end of the system framework include path. +Driver RejectNegative +(Obsolete and unhandled by ld64, ignored) ld should produce an executable (only handled by ld_classic). -X -Driver +;; These are not "real" options, but placeholders used to hide the real options +;; from generic options processing... FIXME: they can be eliminated now. Zall_load Driver @@ -343,62 +481,3 @@ Driver Separate Zweak_reference_mismatches Driver Separate -client_name -Driver Separate - -compatibility_version -Driver Separate - -current_version -Driver Separate - -dylinker_install_name -Driver Separate - -pagezero_size -Driver Separate - -read_only_relocs -Driver Separate - -sectalign -Driver Separate Args(3) - -sectcreate -Driver Separate Args(3) - -sectobjectsymbols -Driver Separate Args(2) - -sectorder -Driver Separate Args(3) - -seg1addr -Driver Separate - -segcreate -Driver Separate Args(3) - -segprot -Driver Separate Args(3) - -segs_read_only_addr -Driver Separate - -segs_read_write_addr -Driver Separate - -sub_library -Driver Separate - -sub_umbrella -Driver Separate - -; Certain aspects of code-gen may be improved / adjusted if the version of ld64 -; is sufficiently modern. -mtarget-linker -Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION) -The version of ld64 in use for this toolchain. - -undefined -Driver Separate diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index c5a06856041..58d059823b8 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -131,7 +131,8 @@ extern int darwin_emit_branch_islands; #undef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) \ %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ - %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} " \ + %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \ + %{mx32:%eDarwin is not an mx32 platform}" \ DARWIN_CC1_SPEC #undef ASM_SPEC diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 532ba05ceb9..97bbb2477d7 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -28862,6 +28862,25 @@ ix86_nopic_noplt_attribute_p (rtx call_op) return false; } +/* Helper to output the jmp/call. */ +static void +ix86_output_jmp_thunk_or_indirect (const char *thunk_name, + bool need_bnd_p, + const int regno) +{ + if (thunk_name != NULL) + { + if (need_bnd_p) + fprintf (asm_out_file, "\tbnd jmp\t"); + else + fprintf (asm_out_file, "\tjmp\t"); + assemble_name (asm_out_file, thunk_name); + putc ('\n', asm_out_file); + } + else + output_indirect_thunk (need_bnd_p, regno); +} + /* Output indirect branch via a call and return thunk. CALL_OP is a register which contains the branch target. XASM is the assembly template for CALL_OP. Branch is a tail call if SIBCALL_P is true. @@ -28902,25 +28921,17 @@ ix86_output_indirect_branch_via_reg (rtx call_op, bool sibcall_p) thunk_name = NULL; if (sibcall_p) - { - if (thunk_name != NULL) - { - if (need_bnd_p) - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); - else - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); - } - else - output_indirect_thunk (need_bnd_p, regno); - } + ix86_output_jmp_thunk_or_indirect (thunk_name, need_bnd_p, regno); else { if (thunk_name != NULL) { if (need_bnd_p) - fprintf (asm_out_file, "\tbnd call\t%s\n", thunk_name); + fprintf (asm_out_file, "\tbnd call\t"); else - fprintf (asm_out_file, "\tcall\t%s\n", thunk_name); + fprintf (asm_out_file, "\tcall\t"); + assemble_name (asm_out_file, thunk_name); + putc ('\n', asm_out_file); return; } @@ -28944,15 +28955,7 @@ ix86_output_indirect_branch_via_reg (rtx call_op, bool sibcall_p) ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel1); - if (thunk_name != NULL) - { - if (need_bnd_p) - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); - else - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); - } - else - output_indirect_thunk (need_bnd_p, regno); + ix86_output_jmp_thunk_or_indirect (thunk_name, need_bnd_p, regno); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel2); @@ -29016,15 +29019,7 @@ ix86_output_indirect_branch_via_push (rtx call_op, const char *xasm, if (sibcall_p) { output_asm_insn (push_buf, &call_op); - if (thunk_name != NULL) - { - if (need_bnd_p) - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); - else - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); - } - else - output_indirect_thunk (need_bnd_p, regno); + ix86_output_jmp_thunk_or_indirect (thunk_name, need_bnd_p, regno); } else { @@ -29083,15 +29078,7 @@ ix86_output_indirect_branch_via_push (rtx call_op, const char *xasm, output_asm_insn (push_buf, &call_op); - if (thunk_name != NULL) - { - if (need_bnd_p) - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); - else - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); - } - else - output_indirect_thunk (need_bnd_p, regno); + ix86_output_jmp_thunk_or_indirect (thunk_name, need_bnd_p, regno); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel2); @@ -29159,13 +29146,15 @@ ix86_output_function_return (bool long_p) if (need_bnd_p) { indirect_return_bnd_needed |= need_thunk; - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); + fprintf (asm_out_file, "\tbnd jmp\t"); } else { indirect_return_needed |= need_thunk; - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); + fprintf (asm_out_file, "\tjmp\t"); } + assemble_name (asm_out_file, thunk_name); + putc ('\n', asm_out_file); } else output_indirect_thunk (need_bnd_p, INVALID_REGNUM); @@ -29205,7 +29194,7 @@ ix86_output_indirect_function_return (rtx ret_op) indirect_return_via_cx_bnd = true; indirect_thunks_bnd_used |= 1 << CX_REG; } - fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name); + fprintf (asm_out_file, "\tbnd jmp\t"); } else { @@ -29214,8 +29203,10 @@ ix86_output_indirect_function_return (rtx ret_op) indirect_return_via_cx = true; indirect_thunks_used |= 1 << CX_REG; } - fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); + fprintf (asm_out_file, "\tjmp\t"); } + assemble_name (asm_out_file, thunk_name); + putc ('\n', asm_out_file); } else output_indirect_thunk (need_bnd_p, regno); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7a374cfd58c..b6e62a2f65d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -42005,6 +42005,11 @@ rtx_is_swappable_p (rtx op, unsigned int *special) case UNSPEC_REDUC_PLUS: case UNSPEC_REDUC: return 1; + case UNSPEC_VPMSUM: + /* vpmsumd is not swappable, but vpmsum[bhw] are. */ + if (GET_MODE (op) == V2DImode) + return 0; + break; } } diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index ff79b93adc2..5b462bcf09d 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -713,7 +713,7 @@ got_mode_name:; { if (tokens[i] == "strict") ret.strict = true; - else if (tokens[i].find ("gbr-offset=") == 0) + else if (!tokens[i].compare (0, strlen ("gbr-offset="), "gbr-offset=")) { std::string offset_str = tokens[i].substr (strlen ("gbr-offset=")); ret.tcb_gbr_offset = integral_argument (offset_str.c_str ()); @@ -934,11 +934,13 @@ sh_option_override (void) if (flag_unsafe_math_optimizations) { /* Enable fsca insn for SH4A if not otherwise specified by the user. */ - if (global_options_set.x_TARGET_FSCA == 0 && TARGET_SH4A_FP) + if (global_options_set.x_TARGET_FSCA == 0 + && (TARGET_SH4A_FP || TARGET_FPU_SH4_300)) TARGET_FSCA = 1; /* Enable fsrra insn for SH4A if not otherwise specified by the user. */ - if (global_options_set.x_TARGET_FSRRA == 0 && TARGET_SH4A_FP) + if (global_options_set.x_TARGET_FSRRA == 0 + && (TARGET_SH4A_FP || TARGET_FPU_SH4_300)) TARGET_FSRRA = 1; } @@ -10814,12 +10816,6 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, emit_insn (gen_add2_insn (scratch0, GEN_INT (vcall_offset))); offset_addr = scratch0; } - else if (scratch0 != scratch1) - { - emit_move_insn (scratch1, GEN_INT (vcall_offset)); - emit_insn (gen_add2_insn (scratch0, scratch1)); - offset_addr = scratch0; - } else gcc_unreachable (); /* FIXME */ emit_load_ptr (scratch0, offset_addr); @@ -12014,9 +12010,11 @@ sh_extending_set_of_reg::use_as_extended_reg (rtx_insn* use_at_insn) const rtx r = gen_reg_rtx (SImode); rtx_insn* i0; if (from_mode == QImode) - i0 = emit_insn_after (gen_extendqisi2 (r, set_src), insn); + i0 = sh_check_add_incdec_notes ( + emit_insn_after (gen_extendqisi2 (r, set_src), insn)); else if (from_mode == HImode) - i0 = emit_insn_after (gen_extendhisi2 (r, set_src), insn); + i0 = sh_check_add_incdec_notes ( + emit_insn_after (gen_extendhisi2 (r, set_src), insn)); else gcc_unreachable (); @@ -12434,7 +12432,7 @@ static void sh_emit_mode_set (int entity ATTRIBUTE_UNUSED, int mode, int prev_mode, HARD_REG_SET regs_live ATTRIBUTE_UNUSED) { - if ((TARGET_SH4A_FP || TARGET_SH4_300) + if ((TARGET_SH4A_FP || TARGET_FPU_SH4_300) && prev_mode != FP_MODE_NONE && prev_mode != mode) { emit_insn (gen_toggle_pr ()); diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index b13d1b3c943..495dc14e12a 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -69,6 +69,8 @@ extern int code_for_indirect_jump_scratch; FPU is disabled (which makes it compatible with SH4al-dsp). */ #define TARGET_SH4A_FP (TARGET_SH4A && TARGET_FPU_ANY) +/* True if the FPU is a SH4-300 variant. */ +#define TARGET_FPU_SH4_300 (TARGET_FPU_ANY && TARGET_SH4_300) /* This is not used by the SH2E calling convention */ #define TARGET_VARARGS_PRETEND_ARGS(FUN_DECL) \ diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 4585c4855c7..46729e7f562 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -9161,7 +9161,7 @@ (xor:SI (reg:SI FPSCR_REG) (const_int FPSCR_PR))) (set (reg:SI FPSCR_MODES_REG) (unspec_volatile:SI [(const_int 0)] UNSPECV_FPSCR_MODES))] - "TARGET_SH4A_FP" + "TARGET_SH4A_FP || TARGET_FPU_SH4_300" "fpchg" [(set_attr "type" "fpscr_toggle")]) @@ -9389,15 +9389,31 @@ (define_expand "negsf2" [(set (match_operand:SF 0 "fp_arith_reg_operand") (neg:SF (match_operand:SF 1 "fp_arith_reg_operand")))] - "TARGET_SH2E") + "TARGET_FPU_ANY" +{ + if (TARGET_FPU_SH4_300) + emit_insn (gen_negsf2_fpscr (operands[0], operands[1])); + else + emit_insn (gen_negsf2_no_fpscr (operands[0], operands[1])); + DONE; +}) -(define_insn "*negsf2_i" +(define_insn "negsf2_no_fpscr" [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") (neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))] - "TARGET_SH2E" + "TARGET_FPU_ANY && !TARGET_FPU_SH4_300" "fneg %0" [(set_attr "type" "fmove")]) +(define_insn "negsf2_fpscr" + [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") + (neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0"))) + (use (reg:SI FPSCR_MODES_REG))] + "TARGET_FPU_SH4_300" + "fneg %0" + [(set_attr "type" "fmove") + (set_attr "fp_mode" "single")]) + (define_expand "sqrtsf2" [(set (match_operand:SF 0 "fp_arith_reg_operand" "") (sqrt:SF (match_operand:SF 1 "fp_arith_reg_operand" "")))] @@ -9487,15 +9503,31 @@ (define_expand "abssf2" [(set (match_operand:SF 0 "fp_arith_reg_operand") (abs:SF (match_operand:SF 1 "fp_arith_reg_operand")))] - "TARGET_SH2E") + "TARGET_FPU_ANY" +{ + if (TARGET_FPU_SH4_300) + emit_insn (gen_abssf2_fpscr (operands[0], operands[1])); + else + emit_insn (gen_abssf2_no_fpscr (operands[0], operands[1])); + DONE; +}) -(define_insn "*abssf2_i" +(define_insn "abssf2_no_fpscr" [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") (abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))] - "TARGET_SH2E" + "TARGET_FPU_ANY && !TARGET_FPU_SH4_300" "fabs %0" [(set_attr "type" "fmove")]) +(define_insn "abssf2_fpscr" + [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") + (abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0"))) + (use (reg:SI FPSCR_MODES_REG))] + "TARGET_FPU_SH4_300" + "fabs %0" + [(set_attr "type" "fmove") + (set_attr "fp_mode" "single")]) + (define_expand "adddf3" [(set (match_operand:DF 0 "fp_arith_reg_operand" "") (plus:DF (match_operand:DF 1 "fp_arith_reg_operand" "") @@ -9671,12 +9703,28 @@ (define_expand "negdf2" [(set (match_operand:DF 0 "fp_arith_reg_operand") (neg:DF (match_operand:DF 1 "fp_arith_reg_operand")))] - "TARGET_FPU_DOUBLE") + "TARGET_FPU_DOUBLE" +{ + if (TARGET_FPU_SH4_300) + emit_insn (gen_negdf2_fpscr (operands[0], operands[1])); + else + emit_insn (gen_negdf2_no_fpscr (operands[0], operands[1])); + DONE; +}) -(define_insn "*negdf2_i" +(define_insn "negdf2_fpscr" + [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") + (neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0"))) + (use (reg:SI FPSCR_MODES_REG))] + "TARGET_FPU_SH4_300" + "fneg %0" + [(set_attr "type" "fmove") + (set_attr "fp_mode" "double")]) + +(define_insn "negdf2_no_fpscr" [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") (neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))] - "TARGET_FPU_DOUBLE" + "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300" "fneg %0" [(set_attr "type" "fmove")]) @@ -9702,15 +9750,31 @@ (define_expand "absdf2" [(set (match_operand:DF 0 "fp_arith_reg_operand") (abs:DF (match_operand:DF 1 "fp_arith_reg_operand")))] - "TARGET_FPU_DOUBLE") + "TARGET_FPU_DOUBLE" +{ + if (TARGET_FPU_SH4_300) + emit_insn (gen_absdf2_fpscr (operands[0], operands[1])); + else + emit_insn (gen_absdf2_no_fpscr (operands[0], operands[1])); + DONE; +}) -(define_insn "*absdf2_i" +(define_insn "absdf2_no_fpscr" [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") (abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))] - "TARGET_FPU_DOUBLE" + "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300" "fabs %0" [(set_attr "type" "fmove")]) +(define_insn "absdf2_fpscr" + [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") + (abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0"))) + (use (reg:SI FPSCR_MODES_REG))] + "TARGET_FPU_SH4_300" + "fabs %0" + [(set_attr "type" "fmove") + (set_attr "fp_mode" "double")]) + (define_expand "extendsfdf2" [(set (match_operand:DF 0 "fp_arith_reg_operand" "") (float_extend:DF (match_operand:SF 1 "fpul_operand" "")))] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecc29fe28fc..8287648d245 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,96 @@ +2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com> + + Backport from mainline + 2019-10-01 Bill Schmidt <wschmdit@linux.ibm.com> + + PR target/91275 + * gcc.target/powerpc/pr91275.c: New. + +2019-09-28 Iain Sandoe <iain@sandoe.co.uk> + + PR target/82920 + * gcc.target/i386/indirect-thunk-bnd-1.c: Adjust scan-asms for Darwin, + do not use -fno-pic on Darwin. + * gcc.target/i386/indirect-thunk-bnd-2.c: Likewise. + * gcc.target/i386/ret-thunk-25.c: Skip for Darwin, which has a + different ABI for returning this category of complex value. + +2019-09-28 Iain Sandoe <iain@sandoe.co.uk> + + Backport from mainline. + 2019-05-14 Iain Sandoe <iain@sandoe.co.uk> + + PR target/82920 + * gcc.target/i386/pr52146.c: Require effective target x32. + * gcc.target/i386/pr52698.c: Likewise. + * gcc.target/i386/pr52857-1.c: Likewise. + * gcc.target/i386/pr52857-2.c: Likewise. + * gcc.target/i386/pr52876.c: Likewise. + * gcc.target/i386/pr53698.c: Likewise. + * gcc.target/i386/pr54157.c: Likewise. + * gcc.target/i386/pr55049-1.c: Likewise. + * gcc.target/i386/pr55093.c: Likewise. + * gcc.target/i386/pr55116-1.c: Likewise. + * gcc.target/i386/pr55116-2.c: Likewise. + * gcc.target/i386/pr55597.c: Likewise. + * gcc.target/i386/pr59929.c: Likewise. + * gcc.target/i386/pr66470.c: Likewise. + +2019-09-28 Iain Sandoe <iain@sandoe.co.uk> + + Backport from mainline. + 2019-05-12 Iain Sandoe <iain@sandoe.co.uk> + Dominique d'Humieres <dominiq@gcc.gnu.org> + + PR target/82920 + * gcc.target/i386/indirect-thunk-1.c: Adjust scan-asms for Darwin, + do not use -fno-pic on Darwin. + * 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-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-attr-8.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-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-7.c: Likewise. + * gcc.target/i386/indirect-thunk-register-1.c: Likewise. + * gcc.target/i386/indirect-thunk-register-2.c: Likewise. + * gcc.target/i386/indirect-thunk-register-3.c: Likewise. + * gcc.target/i386/indirect-thunk-register-4.c: Likewise. + * gcc.target/i386/ret-thunk-1.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-16.c: Likewise. + * gcc.target/i386/ret-thunk-2.c: Likewise. + * gcc.target/i386/ret-thunk-22.c: Likewise. + * gcc.target/i386/ret-thunk-23.c: Likewise. + * gcc.target/i386/ret-thunk-24.c: Likewise. + * gcc.target/i386/ret-thunk-3.c: Likewise. + * gcc.target/i386/ret-thunk-4.c: Likewise. + * gcc.target/i386/ret-thunk-5.c: Likewise. + * gcc.target/i386/ret-thunk-6.c: Likewise. + * gcc.target/i386/ret-thunk-7.c: Likewise. + * gcc.target/i386/ret-thunk-8.c: Likewise. + * gcc.target/i386/ret-thunk-9.c: Likewise. + 2019-09-17 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c index 6e94d2c4865..052d24dabdf 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,9 +12,11 @@ male_indirect_jump (long offset) dispatch(offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { 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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { 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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c index 3c467078964..2cfbd728b4b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,9 +12,11 @@ male_indirect_jump (long offset) dispatch[offset](offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { 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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { 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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c index 2c7fb52b59d..a4c6808f9cd 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -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" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,9 +13,11 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c index 0d3f895009d..15f7f0302b9 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,9 +13,11 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c index 53868f46558..6f2eec85122 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic -fjump-tables" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fjump-tables" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void func0 (void); void func1 (void); @@ -36,8 +37,10 @@ bar (int i) } /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ -/* { 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 {leaq[ \t]*L[0-9]+\(%rip\)} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {addl[ \t]*L[0-9]+-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { 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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c index 7106407b83d..8620bf1d836 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -14,9 +15,11 @@ male_indirect_jump (long offset) dispatch(offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { 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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { 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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c index 27c7e5b029b..42e83416965 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,9 +13,11 @@ male_indirect_jump (long offset) dispatch[offset](offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { 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(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { 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 {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c index 89a2bac8403..6a9c51337d9 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -14,9 +15,11 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */ +/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c index 3eb83c3779a..85ec57b5a8d 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -13,9 +14,11 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */ +/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c index 0098dd1133d..db1d8fb9979 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -14,8 +15,10 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c index ece8de15a4b..24fc43b3ba5 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -13,8 +14,10 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c index d53fc887dcc..b6630288303 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void func0 (void); void func1 (void); @@ -37,7 +38,9 @@ bar (int i) } /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler {leaq[ \t]*L[0-9]+\(%rip\)} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {addl[ \t]*L[0-9]+-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-8.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-8.c index d730d31bda1..eb75968522b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-8.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-8.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void func0 (void); void func1 (void); @@ -36,7 +37,7 @@ bar (int i) } } -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c index 73d16baddc7..6dce9045812 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! x32 } } } */ -/* { dg-options "-O2 -mno-indirect-branch-register -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" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void (*dispatch) (char *); char buf[10]; @@ -11,8 +12,8 @@ foo (void) } /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "bnd jmp\[ \t\]*__x86_indirect_thunk_bnd_rax" { target lp64 } } } */ -/* { dg-final { scan-assembler "bnd call\[ \t\]*__x86_indirect_thunk_bnd_eax" { target ia32 } } } */ +/* { dg-final { scan-assembler "bnd jmp\[ \t\]*_?__x86_indirect_thunk_bnd_rax" { target lp64 } } } */ +/* { dg-final { scan-assembler "bnd call\[ \t\]*_?__x86_indirect_thunk_bnd_eax" { target ia32 } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler "bnd call\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler "bnd ret" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c index 856751ac224..20091c852d7 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! x32 } } } */ -/* { dg-options "-O2 -mno-indirect-branch-register -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" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void (*dispatch) (char *); char buf[10]; @@ -12,8 +13,8 @@ foo (void) } /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "bnd call\[ \t\]*__x86_indirect_thunk_bnd_(r|e)ax" } } */ -/* { dg-final { scan-assembler "bnd call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "bnd call\[ \t\]*_?__x86_indirect_thunk_bnd_(r|e)ax" } } */ +/* { dg-final { scan-assembler "bnd call\[ \t\]*\.?LIND" } } */ /* { dg-final { scan-assembler "bnd ret" } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c index c09dd0afd2d..3dc02f80ff5 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,8 +12,10 @@ male_indirect_jump (long offset) dispatch(offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.âLIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c index 826425a5115..c4adae23dd3 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,8 +12,10 @@ male_indirect_jump (long offset) dispatch[offset](offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c index 385626850a2..b800b40b055 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,8 +13,10 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c index 1ae49b137ca..f68902ddc25 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,7 +13,8 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c index bc185fe98af..fdb1b85bff5 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic -fjump-tables" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fjump-tables" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void func0 (void); void func1 (void); @@ -36,7 +37,7 @@ bar (int i) } /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not "call\[ \t\]*\.?LIND" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c index 869d9040838..7301490d49c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,10 +12,12 @@ male_indirect_jump (long offset) dispatch(offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c index c5c16ed8bd8..ef1ba02978d 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,10 +12,12 @@ male_indirect_jump (long offset) dispatch[offset](offset); } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c index 4a63ebed8ab..58de8f0393e 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,10 +13,12 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */ +/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c index a395ffca018..3be3ce07527 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -12,10 +13,12 @@ male_indirect_jump (long offset) return 0; } -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */ +/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c index e6f064959a1..b161faa44f6 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic -fjump-tables" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fjump-tables" } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ void func0 (void); void func1 (void); @@ -37,8 +38,8 @@ bar (int i) /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%(r|e)ax" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c index 7d396a31953..ea99fd8bdcb 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -mindirect-branch-register -fno-pic" } */ +/* { dg-options "-O2 -mindirect-branch=thunk -mindirect-branch-register " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,12 +12,12 @@ 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 "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" } } */ +/* { 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 index e7e616bb271..30847db480b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -mindirect-branch-register -fno-pic" } */ +/* { dg-options "-O2 -mindirect-branch=thunk-inline -mindirect-branch-register " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,10 +12,10 @@ 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 {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" } } */ +/* { 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 index 5320e923be2..cbe14d52d75 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -mindirect-branch-register -fno-pic" } */ +/* { dg-options "-O2 -mindirect-branch=thunk-extern -mindirect-branch-register " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ typedef void (*dispatch_t)(long offset); @@ -11,9 +12,9 @@ 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\]*_?__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" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c index f0cd9b75be8..6d2bfc911c1 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=keep -fno-pic" } */ +/* { dg-options "-O2 -mindirect-branch=keep " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*func_p) (void); diff --git a/gcc/testsuite/gcc.target/i386/pr52146.c b/gcc/testsuite/gcc.target/i386/pr52146.c index dcc28d007fe..9bd81368bcd 100644 --- a/gcc/testsuite/gcc.target/i386/pr52146.c +++ b/gcc/testsuite/gcc.target/i386/pr52146.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32" } */ void diff --git a/gcc/testsuite/gcc.target/i386/pr52698.c b/gcc/testsuite/gcc.target/i386/pr52698.c index d5cfa741112..8d8988fccc3 100644 --- a/gcc/testsuite/gcc.target/i386/pr52698.c +++ b/gcc/testsuite/gcc.target/i386/pr52698.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/i386/pr52857-1.c b/gcc/testsuite/gcc.target/i386/pr52857-1.c index 5c23339b66a..2e8a4afdc10 100644 --- a/gcc/testsuite/gcc.target/i386/pr52857-1.c +++ b/gcc/testsuite/gcc.target/i386/pr52857-1.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-g -O -mx32 -maddress-mode=long" } */ extern void get_BID128 (int *); diff --git a/gcc/testsuite/gcc.target/i386/pr52857-2.c b/gcc/testsuite/gcc.target/i386/pr52857-2.c index 99acf84347d..62ac5df5eb1 100644 --- a/gcc/testsuite/gcc.target/i386/pr52857-2.c +++ b/gcc/testsuite/gcc.target/i386/pr52857-2.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-g -O -mx32 -maddress-mode=long" } */ void uw_init_context_1 (void *); diff --git a/gcc/testsuite/gcc.target/i386/pr52876.c b/gcc/testsuite/gcc.target/i386/pr52876.c index 6d5e47a94d0..e12c62082e8 100644 --- a/gcc/testsuite/gcc.target/i386/pr52876.c +++ b/gcc/testsuite/gcc.target/i386/pr52876.c @@ -1,4 +1,5 @@ /* { dg-do run { target { x32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/i386/pr53698.c b/gcc/testsuite/gcc.target/i386/pr53698.c index e36200af852..9f36707ecf9 100644 --- a/gcc/testsuite/gcc.target/i386/pr53698.c +++ b/gcc/testsuite/gcc.target/i386/pr53698.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O -mx32 -maddress-mode=long -fno-tree-dominator-opts" } */ extern char foo[]; diff --git a/gcc/testsuite/gcc.target/i386/pr54157.c b/gcc/testsuite/gcc.target/i386/pr54157.c index 26318677d59..01b02c58a90 100644 --- a/gcc/testsuite/gcc.target/i386/pr54157.c +++ b/gcc/testsuite/gcc.target/i386/pr54157.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long -ftree-vectorize" } */ struct s2{ diff --git a/gcc/testsuite/gcc.target/i386/pr55049-1.c b/gcc/testsuite/gcc.target/i386/pr55049-1.c index 387bbeb81fb..6486ce99a27 100644 --- a/gcc/testsuite/gcc.target/i386/pr55049-1.c +++ b/gcc/testsuite/gcc.target/i386/pr55049-1.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target fpic } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -fPIC -mx32" } */ extern void __morestack_fail (const char *msg); diff --git a/gcc/testsuite/gcc.target/i386/pr55093.c b/gcc/testsuite/gcc.target/i386/pr55093.c index bfe2c503d83..190a9423f33 100644 --- a/gcc/testsuite/gcc.target/i386/pr55093.c +++ b/gcc/testsuite/gcc.target/i386/pr55093.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ /* { dg-skip-if "different ABI" { x86_64-*-mingw* } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr55116-1.c b/gcc/testsuite/gcc.target/i386/pr55116-1.c index a2e2acd858a..a7d17ed014e 100644 --- a/gcc/testsuite/gcc.target/i386/pr55116-1.c +++ b/gcc/testsuite/gcc.target/i386/pr55116-1.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ int glob_int_arr[100]; diff --git a/gcc/testsuite/gcc.target/i386/pr55116-2.c b/gcc/testsuite/gcc.target/i386/pr55116-2.c index 59bdebe690d..62ac0a1d001 100644 --- a/gcc/testsuite/gcc.target/i386/pr55116-2.c +++ b/gcc/testsuite/gcc.target/i386/pr55116-2.c @@ -1,4 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ typedef struct rtx_def *rtx; diff --git a/gcc/testsuite/gcc.target/i386/pr55597.c b/gcc/testsuite/gcc.target/i386/pr55597.c index 617c3e5c5ed..b942324892c 100644 --- a/gcc/testsuite/gcc.target/i386/pr55597.c +++ b/gcc/testsuite/gcc.target/i386/pr55597.c @@ -1,5 +1,6 @@ /* { dg-do compile { target { ! ia32 } } } */ /* { dg-require-effective-target fpic } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -fPIC -mx32 -maddress-mode=long" } */ struct initial_sp diff --git a/gcc/testsuite/gcc.target/i386/pr59929.c b/gcc/testsuite/gcc.target/i386/pr59929.c index 4591dc4d601..ea84fbd6369 100644 --- a/gcc/testsuite/gcc.target/i386/pr59929.c +++ b/gcc/testsuite/gcc.target/i386/pr59929.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O0 -mno-accumulate-outgoing-args" } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O0 -mno-accumulate-outgoing-args -mx32 -maddress-mode=short" { target x32 } } */ void diff --git a/gcc/testsuite/gcc.target/i386/pr66470.c b/gcc/testsuite/gcc.target/i386/pr66470.c index 5c068f3d71b..3515b6d2892 100644 --- a/gcc/testsuite/gcc.target/i386/pr66470.c +++ b/gcc/testsuite/gcc.target/i386/pr66470.c @@ -1,5 +1,6 @@ /* PR target/66470 */ /* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ /* { dg-require-effective-target tls } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-1.c b/gcc/testsuite/gcc.target/i386/ret-thunk-1.c index 7223f67ba5e..77f2cf62e26 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-1.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-1.c @@ -6,8 +6,8 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c index af9023af613..1b87a22ddc8 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -10,11 +11,11 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-times {\tpause} 2 } } */ /* { dg-final { scan-assembler-times {\tlfence} 2 } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ -/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "_?__x86_indirect_thunk_(r|e)ax:" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c index ba467c59b36..09b242ae95d 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { 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" } */ +/* { 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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -10,11 +11,11 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ -/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "_?__x86_indirect_thunk_(r|e)ax:" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c index 43e57cac2c3..2c35848e13a 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { 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" } */ +/* { 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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -10,11 +11,11 @@ foo (void) return 0; } -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ -/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "_?__x86_indirect_thunk_(r|e)ax:" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c index 55f156c4376..2f8d3a04cde 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); extern int foo (void) __attribute__ ((function_return("thunk"))); @@ -11,11 +12,11 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-times {\tpause} 2 } } */ /* { dg-final { scan-assembler-times {\tlfence} 2 } } */ -/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 3 } } */ -/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 3 } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_indirect_thunk" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 3 } } */ +/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 3 } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c index 1c790436a53..3eaddee8c34 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -13,9 +14,11 @@ foo (void) /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c index 58aba319cba..70c864014fc 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { 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" } */ +/* { 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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -11,11 +12,13 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler-times {\tpause} 1 } } */ /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-16.c b/gcc/testsuite/gcc.target/i386/ret-thunk-16.c index a16cad16aaa..5f439e4f360 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-16.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-16.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=thunk-inline -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=thunk-inline -mindirect-branch=thunk-extern " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -11,8 +12,8 @@ foo (void) return 0; } -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ -/* { dg-final { scan-assembler-not "__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-2.c b/gcc/testsuite/gcc.target/i386/ret-thunk-2.c index c6659e3ad09..3cb94210746 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-2.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-2.c @@ -6,8 +6,8 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-22.c b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c index 89e086de97b..9a9f42ea6a1 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-22.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c @@ -6,10 +6,12 @@ struct s { _Complex unsigned short x; }; struct s gs = { 100 + 200i }; struct s __attribute__((noinline)) foo (void) { return gs; } -/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ -/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk_ecx" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {call[ \t]*___x86.get_pc_thunk.cx} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*___x86_return_thunk} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-23.c b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c index 43f0ccaa854..69469a43606 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-23.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c @@ -6,10 +6,12 @@ struct s { _Complex unsigned short x; }; struct s gs = { 100 + 200i }; struct s __attribute__((noinline)) foo (void) { return gs; } -/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ -/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk_ecx" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {call[ \t]*___x86.get_pc_thunk.cx} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*___x86_return_thunk} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler-not {\tpause} } } */ /* { dg-final { scan-assembler-not {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-24.c b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c index 8729e35147e..0e7877970d7 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-24.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c @@ -6,10 +6,12 @@ struct s { _Complex unsigned short x; }; struct s gs = { 100 + 200i }; struct s __attribute__((noinline)) foo (void) { return gs; } -/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ -/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk_ecx" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {call[ \t]*___x86.get_pc_thunk.cx} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*___x86_return_thunk} { target { *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-25.c b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c index f73553c9a9f..c0fd9bab257 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-25.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c @@ -1,5 +1,6 @@ /* PR target/r84530 */ /* { dg-do compile { target ia32 } } */ +/* { dg-skip-if "ABI differs for return complex value" { *-*-darwin* } } */ /* { dg-options "-O2 -mfunction-return=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */ struct s { _Complex unsigned short x; }; diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-3.c b/gcc/testsuite/gcc.target/i386/ret-thunk-3.c index 0f7f388f459..eb585169ae2 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-3.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-3.c @@ -6,7 +6,7 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-4.c b/gcc/testsuite/gcc.target/i386/ret-thunk-4.c index 9ae37e835a0..736f7270ba6 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-4.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-4.c @@ -6,7 +6,7 @@ foo (void) { } -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-5.c b/gcc/testsuite/gcc.target/i386/ret-thunk-5.c index 4bd0d2a27bc..862f21da773 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-5.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-5.c @@ -8,8 +8,8 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-6.c b/gcc/testsuite/gcc.target/i386/ret-thunk-6.c index 053841f6f7d..9517c92eade 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-6.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-6.c @@ -7,8 +7,8 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-7.c b/gcc/testsuite/gcc.target/i386/ret-thunk-7.c index 262e6780112..dd68f8326b1 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-7.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-7.c @@ -7,7 +7,7 @@ foo (void) { } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-8.c b/gcc/testsuite/gcc.target/i386/ret-thunk-8.c index c1658e96673..0a611d99f59 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-8.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-8.c @@ -8,7 +8,7 @@ foo (void) { } -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c index eee230ca2f6..8af81522026 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -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 " } */ +/* { dg-additional-options "-fno-pic" { target { ! *-*-darwin* } } } */ extern void (*bar) (void); @@ -10,12 +11,14 @@ foo (void) return 0; } -/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ -/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ -/* { dg-final { scan-assembler "__x86_return_thunk:" } } */ -/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_return_thunk" } } */ +/* { dg-final { scan-assembler {jmp[ \t]+\.?LIND} } } */ +/* { dg-final { scan-assembler {call[ \t]+\.?LIND} } } */ +/* { dg-final { scan-assembler "_?__x86_return_thunk:" } } */ +/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */ +/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */ /* { dg-final { scan-assembler-times {\tpause} 2 } } */ /* { dg-final { scan-assembler-times {\tlfence} 2 } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/pr91275.c b/gcc/testsuite/gcc.target/powerpc/pr91275.c new file mode 100644 index 00000000000..b23d75be29b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr91275.c @@ -0,0 +1,21 @@ +/* Test that we generate vpmsumd correctly without a swap error. */ + +/* { dg-do run { target { p8vector_hw } } } */ +/* { dg-options "-O2 -std=gnu11" } */ + +#include <altivec.h> + +int main() { + + const unsigned long long r0l = 0x8e7dfceac070e3a0; + vector unsigned long long r0 = (vector unsigned long long) {r0l, 0}, v; + const vector unsigned long long pd + = (vector unsigned long) {0xc2LLU << 56, 0}; + + v = __builtin_crypto_vpmsumd ((vector unsigned long long) {r0[0], 0}, pd); + + if (v[0] != 0x4000000000000000 || v[1] != 0x65bd7ab605a4a8ff) + __builtin_abort (); + + return 0; +} diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 38d259671db..4f0b1051075 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,12 @@ +2019-09-28 Oleg Endo <olegendo@gcc.gnu.org> + + Backport from mainline + 2018-08-03 Sergei Trofimovich <slyfox@gentoo.org> + + PR target/86712 + * config/sh/sjlj.S: Adjust to use PIC vs normal code to avoid + absolute relocation in a shared library. + 2018-12-13 Peter Bergner <bergner@linux.ibm.com> Backport from mainline diff --git a/libitm/config/sh/sjlj.S b/libitm/config/sh/sjlj.S index 0159fed2b47..6ed2b8b25b8 100644 --- a/libitm/config/sh/sjlj.S +++ b/libitm/config/sh/sjlj.S @@ -53,7 +53,7 @@ _ITM_beginTransaction: #else cfi_def_cfa_offset (4*10) #endif -#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__ +#if !defined __PIC__ mov.l .Lbegin, r1 jsr @r1 mov r15, r5 @@ -78,7 +78,7 @@ _ITM_beginTransaction: .align 2 .Lbegin: -#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__ +#if !defined __PIC__ .long GTM_begin_transaction #else .long GTM_begin_transaction@PCREL-(.Lbegin0-.) |