+2018-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/85342
+ * regcprop.c (copyprop_hardreg_forward_1): Remove replaced array, use
+ a bool scalar var inside of the loop instead. Don't try to update
+ recog_data.operand after failed apply_change_group.
+
2018-04-12 Tom de Vries <tom@codesourcery.com>
PR target/85296
bool is_asm, any_replacements;
rtx set;
rtx link;
- bool replaced[MAX_RECOG_OPERANDS];
bool changed = false;
struct kill_set_value_data ksvd;
eldest live copy that's in an appropriate register class. */
for (i = 0; i < n_ops; i++)
{
- replaced[i] = false;
+ bool replaced = false;
/* Don't scan match_operand here, since we've no reg class
information to pass down. Any operands that we could
if (recog_data.operand_type[i] == OP_IN)
{
if (op_alt[i].is_address)
- replaced[i]
+ replaced
= replace_oldest_value_addr (recog_data.operand_loc[i],
alternative_class (op_alt, i),
VOIDmode, ADDR_SPACE_GENERIC,
insn, vd);
else if (REG_P (recog_data.operand[i]))
- replaced[i]
+ replaced
= replace_oldest_value_reg (recog_data.operand_loc[i],
alternative_class (op_alt, i),
insn, vd);
else if (MEM_P (recog_data.operand[i]))
- replaced[i] = replace_oldest_value_mem (recog_data.operand[i],
- insn, vd);
+ replaced = replace_oldest_value_mem (recog_data.operand[i],
+ insn, vd);
}
else if (MEM_P (recog_data.operand[i]))
- replaced[i] = replace_oldest_value_mem (recog_data.operand[i],
- insn, vd);
+ replaced = replace_oldest_value_mem (recog_data.operand[i],
+ insn, vd);
/* If we performed any replacement, update match_dups. */
- if (replaced[i])
+ if (replaced)
{
int j;
rtx new_rtx;
{
if (! apply_change_group ())
{
- for (i = 0; i < n_ops; i++)
- if (replaced[i])
- {
- rtx old = *recog_data.operand_loc[i];
- recog_data.operand[i] = old;
- }
-
if (dump_file)
fprintf (dump_file,
"insn %u: reg replacements not verified\n",
--- /dev/null
+/* PR rtl-optimization/85342 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -mavx512vl" } */
+
+typedef unsigned char U __attribute__((vector_size (64)));
+typedef unsigned int V __attribute__((vector_size (64)));
+typedef unsigned __int128 W __attribute__((vector_size (64)));
+int i;
+V g, h, z, k, l, m;
+U j;
+
+W
+bar (W o, W p)
+{
+ U q;
+ o |= (W){q[0]} >= o;
+ o += 1 < o;
+ j |= (U){} == j;
+ return i + (W)q + (W)g + (W)h + (W)z + o + (W)j + (W)k + (W)l + (W)m + p;
+}
+
+W
+foo (U u)
+{
+ U q;
+ W r = bar ((W)(U){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ~0}, (W)q);
+ u += (U)bar ((W){~0}, r);
+ return (W)u;
+}