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
This commit is contained in:
parent
83e23dcd56
commit
53f2f08b05
@ -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
|
||||
|
21
gcc/gcse.c
21
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. */
|
||||
|
@ -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 */
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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
|
||||
|
5
gcc/testsuite/gcc.target/i386/pr88948.c
Normal file
5
gcc/testsuite/gcc.target/i386/pr88948.c
Normal file
@ -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"
|
Loading…
Reference in New Issue
Block a user