re PR target/70302 (crash on valid code at -O2 and -O3 in 32-bit mode on x86_64-linux-gnu (in convert_op, at config/i386/i386.c:3414))

2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>

	PR target/70302
	* config/i386/i386.c (scalar_chain::convert_op): Support
	uninitialized register usage case.

	PR target/70302
	* gcc.target/i386/pr70302.c: New test.

From-SVN: r234406
This commit is contained in:
Ilya Enkovich 2016-03-22 19:00:14 +00:00 committed by Jeff Law
parent a3ca1bc5bd
commit 72c9526d3d
4 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
PR target/70302
* config/i386/i386.c (scalar_chain::convert_op): Support
uninitialized register usage case.
2016-03-22 Richard Biener <rguenther@suse.de>
PR middle-end/70251

View File

@ -3409,6 +3409,20 @@ scalar_chain::convert_op (rtx *op, rtx_insn *insn)
fprintf (dump_file, " Preloading operand for insn %d into r%d\n",
INSN_UID (insn), REGNO (tmp));
}
else if (REG_P (*op))
{
/* We may have not converted register usage in case
this register has no definition. Otherwise it
should be converted in convert_reg. */
df_ref ref;
FOR_EACH_INSN_USE (ref, insn)
if (DF_REF_REGNO (ref) == REGNO (*op))
{
gcc_assert (!DF_REF_CHAIN (ref));
break;
}
*op = gen_rtx_SUBREG (V2DImode, *op, 0);
}
else
{
gcc_assert (SUBREG_P (*op));

View File

@ -1,3 +1,8 @@
2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
PR target/70302
* gcc.target/i386/pr70302.c: New test.
2016-03-22 Richard Biener <rguenther@suse.de>
PR middle-end/70251

View File

@ -0,0 +1,22 @@
/* { dg-do compile { target { ia32 } } } */
/* { dg-options "-O2 -msse2" } */
long a, c, e;
int b, d;
unsigned long long f;
extern void fn2 (const char *, int, int, int);
void
fn1(long long p1)
{
unsigned long long g;
int i;
for (; i;)
if (e)
g = c;
if (a)
f = p1;
if (!f && !g)
fn2("", b, d, d);
}