From: Segher Boessenkool Date: Fri, 30 Jan 2015 05:35:52 +0000 (+0100) Subject: re PR target/64580 (very high rs6000_stack_info() usage during LTO Firefox build... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd1c1f8cb5e4f405d2b6f693ef42b32e47f70b52;p=gcc.git re PR target/64580 (very high rs6000_stack_info() usage during LTO Firefox build on ppc64) PR target/64580 * config.rs6000/rs6000.c (compute_vrsave_mask): Reverse loop order. (rs6000_stack_info): Add assert. (rs6000_output_savres_externs): New function, split off from... (rs6000_output_function_prologue): ... here. Do not call it for thunks. From-SVN: r220272 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c02d43ff2e..a44ff5b3d7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,15 @@ +2015-01-29 Segher Boessenkool + + PR target/64580 + * config.rs6000/rs6000.c (compute_vrsave_mask): Reverse loop order. + (rs6000_stack_info): Add assert. + (rs6000_output_savres_externs): New function, split off from... + (rs6000_output_function_prologue): ... here. Do not call it for + thunks. + 2015-01-29 Jeff Law - PR target/15184 + PR target/15184 * combine.c (try_combine): If I0 is a memory load and I3 a store to a related address, increase the "goodness" of doing a 4-insn combination with I0-I3. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 85eb0fd1b89..40facd926f1 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21145,7 +21145,7 @@ compute_vrsave_mask (void) them in again. More importantly, the mask we compute here is used to generate CLOBBERs in the set_vrsave insn, and we do not wish the argument registers to die. */ - for (i = crtl->args.info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i) + for (i = ALTIVEC_ARG_MIN_REG; i < (unsigned) crtl->args.info.vregno; i++) mask &= ~ALTIVEC_REG_BIT (i); /* Similarly, remove the return value from the set. */ @@ -21554,6 +21554,9 @@ rs6000_savres_strategy (rs6000_stack_t *info, static rs6000_stack_t * rs6000_stack_info (void) { + /* We should never be called for thunks, we are not set up for that. */ + gcc_assert (!cfun->is_thunk); + rs6000_stack_t *info_ptr = &stack_info; int reg_size = TARGET_32BIT ? 4 : 8; int ehrd_size; @@ -24275,11 +24278,10 @@ rs6000_emit_prologue (void) } } -/* Write function prologue. */ +/* Output .extern statements for the save/restore routines we use. */ static void -rs6000_output_function_prologue (FILE *file, - HOST_WIDE_INT size ATTRIBUTE_UNUSED) +rs6000_output_savres_externs (FILE *file) { rs6000_stack_t *info = rs6000_stack_info (); @@ -24311,6 +24313,16 @@ rs6000_output_function_prologue (FILE *file, fprintf (file, "\t.extern %s\n", name); } } +} + +/* Write function prologue. */ + +static void +rs6000_output_function_prologue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + if (!cfun->is_thunk) + rs6000_output_savres_externs (file); /* ELFv2 ABI r2 setup code and local entry point. This must follow immediately after the global entry point label. */