aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/gcse.c21
-rw-r--r--gcc/rtl.h3
-rw-r--r--gcc/store-motion.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr88948.c5
6 files changed, 40 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7b79755..915d32e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2019-01-24 Uroš Bizjak <ubizjak@gmail.com>
+
+ 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.
+
2019-01-24 Jakub Jelinek <jakub@redhat.com>
PR debug/89006
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. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 70891e6..f991919 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -4078,6 +4078,9 @@ extern void init_lower_subreg (void);
/* In gcse.c */
extern bool can_copy_p (machine_mode);
extern bool can_assign_to_reg_without_clobbers_p (rtx, machine_mode);
+extern rtx_insn *prepare_copy_insn (rtx, rtx);
+
+/* In cprop.c */
extern rtx fis_get_condition (rtx_insn *);
/* In ira.c */
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 28c4825..a0838f6 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -912,8 +912,7 @@ replace_store_insn (rtx reg, rtx_insn *del, basic_block bb,
rtx_insn *insn;
rtx mem, note, set;
- mem = smexpr->pattern;
- insn = gen_move_insn (reg, SET_SRC (single_set (del)));
+ insn = prepare_copy_insn (reg, SET_SRC (single_set (del)));
unsigned int i;
rtx_insn *temp;
@@ -946,6 +945,7 @@ replace_store_insn (rtx reg, rtx_insn *del, basic_block bb,
/* Now we must handle REG_EQUAL notes whose contents is equal to the mem;
they are no longer accurate provided that they are reached by this
definition, so drop them. */
+ mem = smexpr->pattern;
for (; insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn))
if (NONDEBUG_INSN_P (insn))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 285c699..e7ac88c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-24 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/88948
+ * gcc.target/i386/pr88948.c: New test.
+
2019-01-24 Jakub Jelinek <jakub@redhat.com>
PR debug/89006
diff --git a/gcc/testsuite/gcc.target/i386/pr88948.c b/gcc/testsuite/gcc.target/i386/pr88948.c
new file mode 100644
index 0000000..5b50803
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88948.c
@@ -0,0 +1,5 @@
+/* PR rtl-optimization/88948 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgcse-sm -msse3 -mfpmath=387" } */
+
+#include "../../gcc.c-torture/execute/stdarg-3.c"