diff options
author | Jie Zhang <jie@codesourcery.com> | 2010-10-23 00:38:13 +0000 |
---|---|---|
committer | Jie Zhang <jiez@gcc.gnu.org> | 2010-10-23 00:38:13 +0000 |
commit | 646e6f415ca6b02142132ebb82c8b11f08d2464f (patch) | |
tree | f19a82621c5689bbcd86c5c3323f03caa5df1ea5 /gcc/config/mips/mips.c | |
parent | 61a796b1698be252fa2834f1da96bbc55da05b22 (diff) | |
download | gcc-646e6f415ca6b02142132ebb82c8b11f08d2464f.zip gcc-646e6f415ca6b02142132ebb82c8b11f08d2464f.tar.gz gcc-646e6f415ca6b02142132ebb82c8b11f08d2464f.tar.bz2 |
re PR rtl-optimization/37360 (ICE in haifa-sched.c when compiling __popcountsi2 from libgcc)
PR rtl-optimization/37360
* config/mips/mips.c (cached_can_issue_more): New local variable.
(mips_sched_reorder_1): New.
(mips_sched_reorder): Use mips_sched_reorder_1.
(mips_sched_reorder2): New.
(mips_variable_issue): Set cached_can_issue_more.
(TARGET_SCHED_REORDER2): Define to mips_sched_reorder2
instead of mips_sched_reorder.
Revert
2008-09-09 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/37360
* haifa-sched.c (max_issue): Do not assert that we never issue more
insns than issue_rate. Add comment.
testsuite/
PR rtl-optimization/37360
* gcc.dg/pr37360.c: New test.
From-SVN: r165880
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 881bb78..3dfc59e 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -589,6 +589,10 @@ static const char *mips_hi_relocs[NUM_SYMBOL_TYPES]; /* Target state for MIPS16. */ struct target_globals *mips16_globals; +/* Cached value of can_issue_more. This is cached in mips_variable_issue hook + and returned from mips_sched_reorder2. */ +static int cached_can_issue_more; + /* Index R is the smallest register class that contains register R. */ const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = { LEA_REGS, LEA_REGS, M16_REGS, V1_REG, @@ -12436,11 +12440,11 @@ mips_sched_init (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, mips_ls2.falu1_turn_p = true; } -/* Implement TARGET_SCHED_REORDER and TARGET_SCHED_REORDER2. */ +/* Subroutine used by TARGET_SCHED_REORDER and TARGET_SCHED_REORDER2. */ -static int -mips_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, - rtx *ready, int *nreadyp, int cycle ATTRIBUTE_UNUSED) +static void +mips_sched_reorder_1 (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx *ready, int *nreadyp, int cycle ATTRIBUTE_UNUSED) { if (!reload_completed && TUNE_MACC_CHAINS @@ -12455,10 +12459,28 @@ mips_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, if (TUNE_74K) mips_74k_agen_reorder (ready, *nreadyp); +} +/* Implement TARGET_SCHED_REORDER. */ + +static int +mips_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx *ready, int *nreadyp, int cycle ATTRIBUTE_UNUSED) +{ + mips_sched_reorder_1 (file, verbose, ready, nreadyp, cycle); return mips_issue_rate (); } +/* Implement TARGET_SCHED_REORDER2. */ + +static int +mips_sched_reorder2 (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx *ready, int *nreadyp, int cycle ATTRIBUTE_UNUSED) +{ + mips_sched_reorder_1 (file, verbose, ready, nreadyp, cycle); + return cached_can_issue_more; +} + /* Update round-robin counters for ALU1/2 and FALU1/2. */ static void @@ -12516,6 +12538,7 @@ mips_variable_issue (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, || recog_memoized (insn) < 0 || get_attr_type (insn) != TYPE_MULTI); + cached_can_issue_more = more; return more; } @@ -16417,7 +16440,7 @@ mips_shift_truncation_mask (enum machine_mode mode) #undef TARGET_SCHED_REORDER #define TARGET_SCHED_REORDER mips_sched_reorder #undef TARGET_SCHED_REORDER2 -#define TARGET_SCHED_REORDER2 mips_sched_reorder +#define TARGET_SCHED_REORDER2 mips_sched_reorder2 #undef TARGET_SCHED_VARIABLE_ISSUE #define TARGET_SCHED_VARIABLE_ISSUE mips_variable_issue #undef TARGET_SCHED_ADJUST_COST |