re PR rtl-optimization/85342 (ICE: SIGSEGV in copyprop_hardreg_forward_1 (regcprop.c:995) with -O2 -mavx512vl)

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.

	* gcc.target/i386/pr85342.c: New test.

From-SVN: r259338
This commit is contained in:
Jakub Jelinek 2018-04-12 10:39:50 +02:00 committed by Jakub Jelinek
parent bf3989207e
commit 868865f40f
4 changed files with 49 additions and 16 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -751,7 +751,6 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
bool is_asm, any_replacements;
rtx set;
rtx link;
bool replaced[MAX_RECOG_OPERANDS];
bool changed = false;
struct kill_set_value_data ksvd;
@ -934,7 +933,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
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
@ -951,26 +950,26 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
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;
@ -989,13 +988,6 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
{
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",

View File

@ -1,3 +1,8 @@
2018-04-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/85342
* gcc.target/i386/pr85342.c: New test.
2018-04-11 Jason Merrill <jason@redhat.com>
* lib/asan-dg.exp (check_effective_target_fsanitize_address): False

View File

@ -0,0 +1,29 @@
/* 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;
}