re PR rtl-optimization/68691 (ICE at -O3 with -g enabled on x86_64-linux-gnu in alter_subregs, at lra-spills.c:610 (in 32-bit mode))

2015-12-10  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/68691
	* lra-spills.c (lra_final_code_change): Check pseudo occurrence
	number in non-debug insns and remove debug insns if necessary.

2015-12-10  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/68691
	* gcc.target/i386/pr68691.c: New.

From-SVN: r231538
This commit is contained in:
Vladimir Makarov 2015-12-10 18:00:47 +00:00 committed by Vladimir Makarov
parent 0da4edf76d
commit 684ffdc9af
4 changed files with 77 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/68691
* lra-spills.c (lra_final_code_change): Check pseudo occurrence
number in non-debug insns and remove debug insns if necessary.
2015-12-10 Martin Sebor <msebor@redhat.com>
* invoke.texi (Warning Options): Update -Wall options. Clarify

View File

@ -708,6 +708,30 @@ lra_final_code_change (void)
}
lra_insn_recog_data_t id = lra_get_insn_recog_data (insn);
struct lra_insn_reg *reg;
for (reg = id->regs; reg != NULL; reg = reg->next)
if (reg->regno >= FIRST_PSEUDO_REGISTER
&& lra_reg_info [reg->regno].nrefs == 0)
break;
if (reg != NULL)
{
/* Pseudos still can be in debug insns in some very rare
and complicated cases, e.g. the pseudo was removed by
inheritance and the debug insn is not EBBs where the
inheritance happened. It is difficult and time
consuming to find what hard register corresponds the
pseudo -- so just remove the debug insn. Another
solution could be assigning hard reg/memory but it
would be a misleading info. It is better not to have
info than have it wrong. */
lra_assert (DEBUG_INSN_P (insn));
lra_invalidate_insn_data (insn);
delete_insn (insn);
continue;
}
struct lra_static_insn_data *static_id = id->insn_static_data;
bool insn_change_p = false;

View File

@ -1,3 +1,8 @@
2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/68691
* gcc.target/i386/pr68691.c: New.
2015-12-10 David Malcolm <dmalcolm@redhat.com>
* lib/multiline.exp (_multiline_expected_outputs): Update comment.

View File

@ -0,0 +1,42 @@
/* { dg-do compile } */
/* { dg-options "-O3 -g" } */
char a, b, i, j;
int c, d, e, f, g, h, n;
char
fn1 ()
{
char k, l, m;
int p;
e = g > f;
for (b = 0; b < 2; b++)
{
for (p = 0; p < 3; p++)
{
for (; h < 1; h++)
{
for (; m;)
goto lbl;
e = g;
}
l = a < 0 || a < d;
}
d++;
for (;;)
{
k = g;
n = -k;
j = n;
c = j;
e = 2;
if (l)
break;
return 2;
}
}
for (;;)
;
lbl:
return i;
}