aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2019-01-24 21:48:01 +0100
committerUros Bizjak <uros@gcc.gnu.org>2019-01-24 21:48:01 +0100
commit53f2f08b057b6b57b5d8b99db10b63de0634715c (patch)
tree7683639a9a2979015a7efcd9b91d92cf8cb3caea /gcc/gcse.c
parent83e23dcd562191e102a63f83822848fa5a3a68ea (diff)
downloadgcc-53f2f08b057b6b57b5d8b99db10b63de0634715c.zip
gcc-53f2f08b057b6b57b5d8b99db10b63de0634715c.tar.gz
gcc-53f2f08b057b6b57b5d8b99db10b63de0634715c.tar.bz2
re PR rtl-optimization/88948 (ICE in elimination_costs_in_insn, at reload1.c:3640 since r264148)
PR target/88948 * rtl.h (prepare_copy_insn): New prototype. * gcse.c (prepare_copy_insn): New function, split out from process_insert_insn. (process_insert_insn): Use prepare_copy_insn. * store-motion.c (replace_store_insn): Use prepare_copy_insn instead of gen_move_insn. testsuite/ChangeLog: PR target/88948 * gcc.target/i386/pr88948.c: New test. From-SVN: r268249
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 35716cd..6c77671 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1963,14 +1963,11 @@ pre_expr_reaches_here_p (basic_block occr_bb, struct gcse_expr *expr, basic_bloc
return rval;
}
-/* Generate RTL to copy an EXPR to its `reaching_reg' and return it. */
+/* Generate RTL to copy an EXP to REG and return it. */
-static rtx_insn *
-process_insert_insn (struct gcse_expr *expr)
+rtx_insn *
+prepare_copy_insn (rtx reg, rtx exp)
{
- rtx reg = expr->reaching_reg;
- /* Copy the expression to make sure we don't have any sharing issues. */
- rtx exp = copy_rtx (expr->expr);
rtx_insn *pat;
start_sequence ();
@@ -1996,6 +1993,18 @@ process_insert_insn (struct gcse_expr *expr)
return pat;
}
+/* Generate RTL to copy an EXPR to its `reaching_reg' and return it. */
+
+static rtx_insn *
+process_insert_insn (struct gcse_expr *expr)
+{
+ rtx reg = expr->reaching_reg;
+ /* Copy the expression to make sure we don't have any sharing issues. */
+ rtx exp = copy_rtx (expr->expr);
+
+ return prepare_copy_insn (reg, exp);
+}
+
/* Add EXPR to the end of basic block BB.
This is used by both the PRE and code hoisting. */