From: Iain Sandoe Date: Sun, 13 Oct 2019 18:58:50 +0000 (+0000) Subject: [Darwin, machopic 8/n] Back out part of PR71767 fix. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f922d945244558904be6868dc036c31fd05750dd;p=gcc.git [Darwin, machopic 8/n] Back out part of PR71767 fix. We applied a conservative, but fairly large, hammer to fix PR71767. However, ideally, we want minimise the number of symbols visible to ld64 and to match the cases emitted by clang (since that's what ld64 is expecting). Now we've improved the handling of indirections, we can make the indirection symbols local when they are in the regular non-lazy symbol pointers section. We will continue to make any indirections in the data section visible (since right now we have no way to track if a given symbol follows a weak global). This change makes no difference to handling of labels for constants (to be revised in a future patch). There's a mechanical change to a number of tests (allowing 'l' or 'L' as the indirection symbol prefix). gcc/ChangeLog: 2019-10-13 Iain Sandoe * config/darwin.c (machopic_indirection_name): Rework the function to emit linker-visible symbols only for indirections in the data section. Clean up the code and update comments. gcc/testsuite/ChangeLog: 2019-10-13 Iain Sandoe * gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in indirection label prefix, for 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-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-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-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/pr32219-2.c: Likewise. * gcc.target/i386/pr32219-3.c: Likewise. * gcc.target/i386/pr32219-4.c: Likewise. * gcc.target/i386/pr32219-7.c: Likewise. * gcc.target/i386/pr32219-8.c: Likewise. * gcc.target/i386/ret-thunk-14.c: Likewise. * gcc.target/i386/ret-thunk-15.c: Likewise. * gcc.target/i386/ret-thunk-9.c: Likewise. From-SVN: r276943 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c72f4d86729..61c8a0f1482 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-13 Iain Sandoe + + * config/darwin.c (machopic_indirection_name): Rework the + function to emit linker-visible symbols only for indirections + in the data section. Clean up the code and update comments. + 2019-10-13 Iain Sandoe * config/darwin.c (machopic_indirect_data_reference): Remove diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index eefffee55f6..8635fc2b441 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -495,7 +495,7 @@ indirection_hasher::equal (machopic_indirection *s, const char *k) /* Return the name of the non-lazy pointer (if STUB_P is false) or stub (if STUB_B is true) corresponding to the given name. - If we have a situation like: + PR71767 - If we have a situation like: global_weak_symbol: .... @@ -504,36 +504,22 @@ Lnon_weak_local: ld64 will be unable to split this into two atoms (because the "L" makes the second symbol 'invisible'). This means that legitimate direct accesses - to the second symbol will appear to be non-allowed direct accesses to an - atom of type weak, global which are not allowed. + to the second symbol will appear to be direct accesses to an atom of type + weak, global which are not allowed. - To avoid this, we make the indirections have a leading 'l' (lower-case L) - which has a special meaning: linker can see this and use it to determine - atoms, but it is not placed into the final symbol table. - - The implementation here is somewhat heavy-handed in that it will also mark - indirections to the __IMPORT,__pointers section the same way which is - really unnecessary, since ld64 _can_ split those into atoms as they are - fixed size. FIXME: determine if this is a penalty worth extra code to - fix. + To avoid this, we make any data-section indirections have a leading 'l' + (lower-case L) which has a special meaning: linker can see this and use + it to determine atoms, but it is not placed into the final symbol table. + Symbols in the non-lazy symbol pointers section (or stubs) do not have this + problem because ld64 already knows the size of each entry. */ const char * machopic_indirection_name (rtx sym_ref, bool stub_p) { - char *buffer; const char *name = XSTR (sym_ref, 0); - size_t namelen = strlen (name); - machopic_indirection *p; - bool needs_quotes; - const char *suffix; - char L_or_l = 'L'; - const char *prefix = user_label_prefix; - const char *quote = ""; - tree id; - - id = maybe_get_identifier (name); + tree id = maybe_get_identifier (name); if (id) { tree id_orig = id; @@ -541,43 +527,47 @@ machopic_indirection_name (rtx sym_ref, bool stub_p) while (IDENTIFIER_TRANSPARENT_ALIAS (id)) id = TREE_CHAIN (id); if (id != id_orig) - { - name = IDENTIFIER_POINTER (id); - namelen = strlen (name); - } + name = IDENTIFIER_POINTER (id); } + const char *prefix = user_label_prefix; + /* If we are emitting the label 'verbatim' then omit the U_L_P and count + the name without the leading '*'. */ if (name[0] == '*') { prefix = ""; ++name; - --namelen; } - needs_quotes = name_needs_quotes (name); - if (needs_quotes) - { - quote = "\""; - } - - if (stub_p) - suffix = STUB_SUFFIX; - else - { - suffix = NON_LAZY_POINTER_SUFFIX; - /* Let the linker see this. */ - L_or_l = 'l'; - } - - buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */ - + strlen (prefix) - + namelen - + strlen (suffix) - + 2 * strlen (quote) - + 1 /* '\0' */); + /* Here we are undoing a number of causes that placed some indirections + (apparently erroneously) into the .data section. Specifically, some + symbols that are ABI mandated indirections and some hidden symbols + were being placed there - which cause difficulties with later + versions of ld64. Iff (after these checks) some symbol still gets an + indirection in the data section, we want to adjust the indirection + name to be linker visible to deal with PR71767 (notes above). */ + bool nlsp_in_data_section = + ! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref) + && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref) + && (machopic_symbol_defined_p (sym_ref) || SYMBOL_REF_LOCAL_P (sym_ref)) + && ! indirect_data (sym_ref); + + const char *suffix = stub_p ? STUB_SUFFIX : NON_LAZY_POINTER_SUFFIX; + /* If the indirection is in the data section, let the linker see it. */ + char L_or_l = (!stub_p && nlsp_in_data_section) ? 'l' : 'L'; + /* We have mangled symbols with spaces and punctuation which typically + need surrounding in quotes for the assembler to consume them. */ + const char *quote = name_needs_quotes (name) ? "\"" : ""; + char *buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */ + + strlen (prefix) + + strlen (name) + + strlen (suffix) + + 2 * strlen (quote) + + 1 /* '\0' */); /* Construct the name of the non-lazy pointer or stub. */ - sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name, suffix, quote); + sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name, + suffix, quote); if (!machopic_indirections) machopic_indirections = hash_table::create_ggc (37); @@ -586,10 +576,9 @@ machopic_indirection_name (rtx sym_ref, bool stub_p) = machopic_indirections->find_slot_with_hash (buffer, htab_hash_string (buffer), INSERT); + machopic_indirection *p; if (*slot) - { - p = *slot; - } + p = *slot; else { p = ggc_alloc (); @@ -597,18 +586,7 @@ machopic_indirection_name (rtx sym_ref, bool stub_p) p->ptr_name = xstrdup (buffer); p->stub_p = stub_p; p->used = false; - /* Here we are undoing a number of causes that placed some indirections - (apparently erroneously) into the .data section. Specifically, some - symbols that are ABI mandated indirections and some hidden symbols - were being placed there - which cause difficulties with later - versions of ld64. - */ - p->nlsp_in_data_section = - ! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref) - && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref) - && (machopic_symbol_defined_p (sym_ref) - || SYMBOL_REF_LOCAL_P (sym_ref)) - && ! indirect_data (sym_ref); + p->nlsp_in_data_section = nlsp_in_data_section; *slot = p; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eca8cc6e44d..c14075b80c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,33 @@ +2019-10-13 Iain Sandoe + + * gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in + indirection label prefix, for 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-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-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-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/pr32219-2.c: Likewise. + * gcc.target/i386/pr32219-3.c: Likewise. + * gcc.target/i386/pr32219-4.c: Likewise. + * gcc.target/i386/pr32219-7.c: Likewise. + * gcc.target/i386/pr32219-8.c: Likewise. + * gcc.target/i386/ret-thunk-14.c: Likewise. + * gcc.target/i386/ret-thunk-15.c: Likewise. + * gcc.target/i386/ret-thunk-9.c: Likewise. + 2019-10-13 Damian Rouson PR fortran/91513 diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c index 052d24dabdf..e2914a8333c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c index 2cfbd728b4b..d2b7c74b143 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c index 59bb08613b7..129fb2125f0 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c index 59640fab8f1..01996fb029f 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 8620bf1d836..1493e18243b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c @@ -17,7 +17,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 42e83416965..3ddd4980b69 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 6a9c51337d9..43d5f95b4fb 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c @@ -17,7 +17,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 85ec57b5a8d..bf62636c63c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c @@ -16,7 +16,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 db1d8fb9979..27ba82932e4 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c @@ -17,7 +17,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 24fc43b3ba5..bdf15d36bac 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c @@ -16,7 +16,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 3dc02f80ff5..c30c331c23b 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 c4adae23dd3..7edd7313027 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 b800b40b055..8e391797c5e 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 f68902ddc25..6033d13e8a7 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c @@ -15,6 +15,6 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c index 7301490d49c..ef3577d2934 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 ef1ba02978d..f26a5fb9015 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c @@ -14,7 +14,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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} } } */ 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 58de8f0393e..3b8a1eeaffb 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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 } } */ 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 3be3ce07527..40d31803a2e 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c @@ -15,7 +15,7 @@ male_indirect_jump (long offset) /* { 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 {movl[ \t]*[Ll]_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 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr32219-2.c b/gcc/testsuite/gcc.target/i386/pr32219-2.c index cb587db47aa..b6212f7dd4c 100644 --- a/gcc/testsuite/gcc.target/i386/pr32219-2.c +++ b/gcc/testsuite/gcc.target/i386/pr32219-2.c @@ -20,5 +20,5 @@ foo () /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ /* Darwin m32 defaults to PIC but common symbols need to be indirected. */ -/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr32219-3.c b/gcc/testsuite/gcc.target/i386/pr32219-3.c index f9cfca7d72c..a1b0df28d0d 100644 --- a/gcc/testsuite/gcc.target/i386/pr32219-3.c +++ b/gcc/testsuite/gcc.target/i386/pr32219-3.c @@ -24,4 +24,4 @@ foo () /* For Darwin, we need PIC to allow PIE, but also we must indirect weak symbols so that they can be indirected. Again, dyld knows how to deal with this. */ -/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr32219-4.c b/gcc/testsuite/gcc.target/i386/pr32219-4.c index 0ac0674ae17..31d0710b7ed 100644 --- a/gcc/testsuite/gcc.target/i386/pr32219-4.c +++ b/gcc/testsuite/gcc.target/i386/pr32219-4.c @@ -21,4 +21,4 @@ foo () /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ /* Darwin m32 equivalent (indirect and PIC). */ -/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr32219-7.c b/gcc/testsuite/gcc.target/i386/pr32219-7.c index 469e9e38b07..20fef8dd063 100644 --- a/gcc/testsuite/gcc.target/i386/pr32219-7.c +++ b/gcc/testsuite/gcc.target/i386/pr32219-7.c @@ -23,4 +23,4 @@ foo () /* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ /* Darwin m32 equivalent (indirect and PIC). */ -/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr32219-8.c b/gcc/testsuite/gcc.target/i386/pr32219-8.c index 75eb287fc59..767928f049e 100644 --- a/gcc/testsuite/gcc.target/i386/pr32219-8.c +++ b/gcc/testsuite/gcc.target/i386/pr32219-8.c @@ -21,4 +21,4 @@ foo () /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ /* Darwin m32 default to PIC but needs indirection for the weak symbol. */ -/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ +/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c index 3eaddee8c34..881f541772c 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c @@ -19,6 +19,6 @@ foo (void) /* { 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 {movl[ \t]*[Ll]_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 2793f72cdc1..5687440bf31 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c @@ -19,6 +19,6 @@ foo (void) /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ /* { 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 {movl[ \t]*[Ll]_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-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c index 63af6741e05..3d4497000dc 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c @@ -17,7 +17,7 @@ foo (void) /* { 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 {movl[ \t]*[Ll]_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" } } */