From: Jan Hubicka Date: Thu, 4 Mar 2004 21:31:43 +0000 (+0100) Subject: reload.c (find_reloads): Reorganize if seqeunce to switch. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f345f21a90e56d8f1f9a61e96519a9de2ede2d04;p=gcc.git reload.c (find_reloads): Reorganize if seqeunce to switch. * reload.c (find_reloads): Reorganize if seqeunce to switch. * cfgrtl.c (rtl_redirect_edge_and_branch): Set the source BB as dirty. (cfglayout_redirect_edge_and_branch): Set the source BB as dirty. From-SVN: r78936 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 16fa29c669b..f126b1c591b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-03-04 Jan Hubicka + + * reload.c (find_reloads): Reorganize if seqeunce to switch. + + * cfgrtl.c (rtl_redirect_edge_and_branch): Set the source BB as dirty. + (cfglayout_redirect_edge_and_branch): Set the source BB as dirty. + 2004-03-04 Steve Ellcey * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 35d7c9ebe1b..3363a2d9720 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -933,6 +933,8 @@ redirect_branch_edge (edge e, basic_block target) static bool rtl_redirect_edge_and_branch (edge e, basic_block target) { + basic_block src = e->src; + if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) return false; @@ -940,11 +942,15 @@ rtl_redirect_edge_and_branch (edge e, basic_block target) return true; if (try_redirect_by_replacing_jump (e, target, false)) - return true; + { + src->flags |= BB_DIRTY; + return true; + } if (!redirect_branch_edge (e, target)) return false; + src->flags |= BB_DIRTY; return true; } @@ -2379,7 +2385,10 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) if (e->src != ENTRY_BLOCK_PTR && try_redirect_by_replacing_jump (e, dest, true)) - return true; + { + src->flags |= BB_DIRTY; + return true; + } if (e->src == ENTRY_BLOCK_PTR && (e->flags & EDGE_FALLTHRU) && !(e->flags & EDGE_COMPLEX)) @@ -2388,6 +2397,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) fprintf (dump_file, "Redirecting entry edge from bb %i to %i\n", e->src->index, dest->index); + e->src->flags |= BB_DIRTY; redirect_edge_succ (e, dest); return true; } @@ -2411,6 +2421,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) if (!redirect_branch_edge (e, dest)) abort (); e->flags |= EDGE_FALLTHRU; + e->src->flags |= BB_DIRTY; return true; } /* In case we are redirecting fallthru edge to the branch edge @@ -2438,6 +2449,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) if (simplejump_p (BB_END (src))) abort (); + src->flags |= BB_DIRTY; return ret; } diff --git a/gcc/reload.c b/gcc/reload.c index d3cdaa844a7..f1682f73aee 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2610,62 +2610,71 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, while ((c = *p)) { p += CONSTRAINT_LEN (c, p); - if (c == '=') - modified[i] = RELOAD_WRITE; - else if (c == '+') - modified[i] = RELOAD_READ_WRITE; - else if (c == '%') + switch (c) { - /* The last operand should not be marked commutative. */ - if (i == noperands - 1) - abort (); - - /* We currently only support one commutative pair of - operands. Some existing asm code currently uses more - than one pair. Previously, that would usually work, - but sometimes it would crash the compiler. We - continue supporting that case as well as we can by - silently ignoring all but the first pair. In the - future we may handle it correctly. */ - if (commutative < 0) - commutative = i; - else if (!this_insn_is_asm) - abort (); - } - else if (ISDIGIT (c)) - { - c = strtoul (p - 1, &p, 10); + case '=': + modified[i] = RELOAD_WRITE; + break; + case '+': + modified[i] = RELOAD_READ_WRITE; + break; + case '%': + { + /* The last operand should not be marked commutative. */ + if (i == noperands - 1) + abort (); - operands_match[c][i] - = operands_match_p (recog_data.operand[c], - recog_data.operand[i]); + /* We currently only support one commutative pair of + operands. Some existing asm code currently uses more + than one pair. Previously, that would usually work, + but sometimes it would crash the compiler. We + continue supporting that case as well as we can by + silently ignoring all but the first pair. In the + future we may handle it correctly. */ + if (commutative < 0) + commutative = i; + else if (!this_insn_is_asm) + abort (); + } + break; + /* Use of ISDIGIT is tempting here, but it may get expensive because + of locale support we don't want. */ + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + c = strtoul (p - 1, &p, 10); - /* An operand may not match itself. */ - if (c == i) - abort (); + operands_match[c][i] + = operands_match_p (recog_data.operand[c], + recog_data.operand[i]); - /* If C can be commuted with C+1, and C might need to match I, - then C+1 might also need to match I. */ - if (commutative >= 0) - { - if (c == commutative || c == commutative + 1) - { - int other = c + (c == commutative ? 1 : -1); - operands_match[other][i] - = operands_match_p (recog_data.operand[other], - recog_data.operand[i]); - } - if (i == commutative || i == commutative + 1) - { - int other = i + (i == commutative ? 1 : -1); - operands_match[c][other] - = operands_match_p (recog_data.operand[c], - recog_data.operand[other]); - } - /* Note that C is supposed to be less than I. - No need to consider altering both C and I because in - that case we would alter one into the other. */ - } + /* An operand may not match itself. */ + if (c == i) + abort (); + + /* If C can be commuted with C+1, and C might need to match I, + then C+1 might also need to match I. */ + if (commutative >= 0) + { + if (c == commutative || c == commutative + 1) + { + int other = c + (c == commutative ? 1 : -1); + operands_match[other][i] + = operands_match_p (recog_data.operand[other], + recog_data.operand[i]); + } + if (i == commutative || i == commutative + 1) + { + int other = i + (i == commutative ? 1 : -1); + operands_match[c][other] + = operands_match_p (recog_data.operand[c], + recog_data.operand[other]); + } + /* Note that C is supposed to be less than I. + No need to consider altering both C and I because in + that case we would alter one into the other. */ + } + } } } }