diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2019-09-22 19:24:14 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-09-22 19:24:14 +0000 |
commit | f1c22d660bc467c1816817d1240a0be5a42d1c56 (patch) | |
tree | 15072fbaf7e225974a481ea4b6383186e78f8170 | |
parent | 0968003dd08a9e9f83bee955bbdc259a781f044f (diff) | |
download | gcc-f1c22d660bc467c1816817d1240a0be5a42d1c56.zip gcc-f1c22d660bc467c1816817d1240a0be5a42d1c56.tar.gz gcc-f1c22d660bc467c1816817d1240a0be5a42d1c56.tar.bz2 |
[Darwin, PPC] Clean up symbol stubs code.
Remove dead code for the the TARGET_LINK_STACK which is not
applicable to Darwin. Use MACHOPIC_PURE instead of a hard-wired
PIC level to determine the stub kind.
Merge common code blocks.
gcc/ChangeLog:
2019-09-22 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000.c (machopic_output_stub): Remove dead
code. Merge code blocks with common conditionals. Use declared
macro instead of a magic number for PIC level.
From-SVN: r276030
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 26 |
2 files changed, 12 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 72b2151..2030879 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-22 Iain Sandoe <iain@sandoe.co.uk> + + * config/rs6000/rs6000.c (machopic_output_stub): Remove dead + code. Merge code blocks with common conditionals. Use declared + macro instead of a magic number for PIC level. + 2019-09-21 Martin Sebor <msebor@redhat.com> PR middle-end/91830 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c2834bd..81aec9c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -19499,7 +19499,6 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) /* Lose our funky encoding stuff so it doesn't contaminate the stub. */ symb = (*targetm.strip_name_encoding) (symb); - length = strlen (symb); symbol_name = XALLOCAVEC (char, length + 32); GEN_SYMBOL_NAME_FOR_SYMBOL (symbol_name, symb, length); @@ -19507,13 +19506,9 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) lazy_ptr_name = XALLOCAVEC (char, length + 32); GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length); - if (flag_pic == 2) - switch_to_section (darwin_sections[machopic_picsymbol_stub1_section]); - else - switch_to_section (darwin_sections[machopic_symbol_stub1_section]); - - if (flag_pic == 2) + if (MACHOPIC_PURE) { + switch_to_section (darwin_sections[machopic_picsymbol_stub1_section]); fprintf (file, "\t.align 5\n"); fprintf (file, "%s:\n", stub); @@ -19524,18 +19519,8 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) sprintf (local_label_0, "L%u$spb", label); fprintf (file, "\tmflr r0\n"); - if (TARGET_LINK_STACK) - { - char name[32]; - get_ppc476_thunk_name (name); - fprintf (file, "\tbl %s\n", name); - fprintf (file, "%s:\n\tmflr r11\n", local_label_0); - } - else - { - fprintf (file, "\tbcl 20,31,%s\n", local_label_0); - fprintf (file, "%s:\n\tmflr r11\n", local_label_0); - } + fprintf (file, "\tbcl 20,31,%s\n", local_label_0); + fprintf (file, "%s:\n\tmflr r11\n", local_label_0); fprintf (file, "\taddis r11,r11,ha16(%s-%s)\n", lazy_ptr_name, local_label_0); fprintf (file, "\tmtlr r0\n"); @@ -19545,8 +19530,9 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) fprintf (file, "\tmtctr r12\n"); fprintf (file, "\tbctr\n"); } - else + else /* mdynamic-no-pic or mkernel. */ { + switch_to_section (darwin_sections[machopic_symbol_stub1_section]); fprintf (file, "\t.align 4\n"); fprintf (file, "%s:\n", stub); |