diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2019-03-25 21:14:40 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2019-03-25 21:14:40 +0000 |
commit | 33163a622d9f334e862078419782e3d967bb3db3 (patch) | |
tree | 905642bc07617588866bff4791c05f5f23552a95 /gcc/lra-constraints.c | |
parent | 0abbc99c023b99e9fad6308f9a0cdfc1599b5b31 (diff) | |
download | gcc-33163a622d9f334e862078419782e3d967bb3db3.zip gcc-33163a622d9f334e862078419782e3d967bb3db3.tar.gz gcc-33163a622d9f334e862078419782e3d967bb3db3.tar.bz2 |
re PR rtl-optimization/89676 (Redundant moves for long long shift on 32bit x86)
2019-03-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/89676
* lra-constraints.c (curr_insn_transform): Do match reload for
early clobbers when the match was successful only for different
registers.
From-SVN: r269924
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 78932cc..cf33da8 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -4259,15 +4259,27 @@ curr_insn_transform (bool check_only_p) else if (goal_alt_matched[i][0] != -1 && curr_static_id->operand[i].type == OP_OUT && (curr_static_id->operand_alternative - [goal_alt_number * n_operands + i].earlyclobber)) + [goal_alt_number * n_operands + i].earlyclobber) + && REG_P (op)) { - /* Generate reloads for output and matched inputs. This - is the easiest way to avoid creation of non-existing - conflicts in lra-lives.c. */ - match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before, - &after, TRUE); - outputs[n_outputs++] = i; - outputs[n_outputs] = -1; + for (j = 0; goal_alt_matched[i][j] != -1; j++) + { + rtx op2 = *curr_id->operand_loc[goal_alt_matched[i][j]]; + + if (REG_P (op2) && REGNO (op) != REGNO (op2)) + break; + } + if (goal_alt_matched[i][j] != -1) + { + /* Generate reloads for different output and matched + input registers. This is the easiest way to avoid + creation of non-existing register conflicts in + lra-lives.c. */ + match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before, + &after, TRUE); + outputs[n_outputs++] = i; + outputs[n_outputs] = -1; + } continue; } else |