Commit f2b29269 by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

re PR target/90723 (pr88598-2.c segfaults with -msve-vector-bits=256)

2019-07-15  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR target/90723
	* recog.h (temporary_volatile_ok): New class.
	* config/aarch64/aarch64.c (aarch64_emit_sve_pred_move): Set
	volatile_ok temporarily to true using temporary_volatile_ok.
	* expr.c (emit_block_move_via_cpymem): Likewise.
	* optabs.c (maybe_legitimize_operand): Likewise.

From-SVN: r273466
parent 1a888209
2019-07-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR target/90723
* recog.h (temporary_volatile_ok): New class.
* config/aarch64/aarch64.c (aarch64_emit_sve_pred_move): Set
volatile_ok temporarily to true using temporary_volatile_ok.
* expr.c (emit_block_move_via_cpymem): Likewise.
* optabs.c (maybe_legitimize_operand): Likewise.
2019-07-13 Jakub Jelinek <jakub@redhat.com> 2019-07-13 Jakub Jelinek <jakub@redhat.com>
* gimplify.c (struct gimplify_omp_ctx): Add order_concurrent member. * gimplify.c (struct gimplify_omp_ctx): Add order_concurrent member.
......
...@@ -3457,6 +3457,7 @@ aarch64_emit_sve_pred_move (rtx dest, rtx pred, rtx src) ...@@ -3457,6 +3457,7 @@ aarch64_emit_sve_pred_move (rtx dest, rtx pred, rtx src)
create_output_operand (&ops[0], dest, mode); create_output_operand (&ops[0], dest, mode);
create_input_operand (&ops[1], pred, GET_MODE(pred)); create_input_operand (&ops[1], pred, GET_MODE(pred));
create_input_operand (&ops[2], src, mode); create_input_operand (&ops[2], src, mode);
temporary_volatile_ok v (true);
expand_insn (code_for_aarch64_pred_mov (mode), 3, ops); expand_insn (code_for_aarch64_pred_mov (mode), 3, ops);
} }
......
...@@ -1732,8 +1732,6 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align, ...@@ -1732,8 +1732,6 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align,
unsigned HOST_WIDE_INT max_size, unsigned HOST_WIDE_INT max_size,
unsigned HOST_WIDE_INT probable_max_size) unsigned HOST_WIDE_INT probable_max_size)
{ {
int save_volatile_ok = volatile_ok;
if (expected_align < align) if (expected_align < align)
expected_align = align; expected_align = align;
if (expected_size != -1) if (expected_size != -1)
...@@ -1745,7 +1743,7 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align, ...@@ -1745,7 +1743,7 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align,
} }
/* Since this is a move insn, we don't care about volatility. */ /* Since this is a move insn, we don't care about volatility. */
volatile_ok = 1; temporary_volatile_ok v (true);
/* Try the most limited insn first, because there's no point /* Try the most limited insn first, because there's no point
including more than one in the machine description unless including more than one in the machine description unless
...@@ -1809,14 +1807,10 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align, ...@@ -1809,14 +1807,10 @@ emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align,
create_fixed_operand (&ops[8], NULL); create_fixed_operand (&ops[8], NULL);
} }
if (maybe_expand_insn (code, nops, ops)) if (maybe_expand_insn (code, nops, ops))
{ return true;
volatile_ok = save_volatile_ok;
return true;
}
} }
} }
volatile_ok = save_volatile_ok;
return false; return false;
} }
......
...@@ -7202,17 +7202,15 @@ maybe_legitimize_operand (enum insn_code icode, unsigned int opno, ...@@ -7202,17 +7202,15 @@ maybe_legitimize_operand (enum insn_code icode, unsigned int opno,
class expand_operand *op) class expand_operand *op)
{ {
machine_mode mode, imode; machine_mode mode, imode;
bool old_volatile_ok, result;
mode = op->mode; mode = op->mode;
switch (op->type) switch (op->type)
{ {
case EXPAND_FIXED: case EXPAND_FIXED:
old_volatile_ok = volatile_ok; {
volatile_ok = true; temporary_volatile_ok v (true);
result = maybe_legitimize_operand_same_code (icode, opno, op); return maybe_legitimize_operand_same_code (icode, opno, op);
volatile_ok = old_volatile_ok; }
return result;
case EXPAND_OUTPUT: case EXPAND_OUTPUT:
gcc_assert (mode != VOIDmode); gcc_assert (mode != VOIDmode);
......
...@@ -186,6 +186,23 @@ skip_alternative (const char *p) ...@@ -186,6 +186,23 @@ skip_alternative (const char *p)
/* Nonzero means volatile operands are recognized. */ /* Nonzero means volatile operands are recognized. */
extern int volatile_ok; extern int volatile_ok;
/* RAII class for temporarily setting volatile_ok. */
class temporary_volatile_ok
{
public:
temporary_volatile_ok (int value) : save_volatile_ok (volatile_ok)
{
volatile_ok = value;
}
~temporary_volatile_ok () { volatile_ok = save_volatile_ok; }
private:
temporary_volatile_ok (const temporary_volatile_ok &);
int save_volatile_ok;
};
/* Set by constrain_operands to the number of the alternative that /* Set by constrain_operands to the number of the alternative that
matched. */ matched. */
extern int which_alternative; extern int which_alternative;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment