re PR debug/44028 (-fcompare-debug failure (length) with -O3 -fsched-pressure -fschedule-insns)

PR debug/44028
	* haifa-sched.c (schedule_insn): When clearing INSN_VAR_LOCATION_LOC,
	clear also INSN_REG_USE_LIST.

	* gcc.dg/pr44028.c: New test.

From-SVN: r159240
This commit is contained in:
Jakub Jelinek 2010-05-10 20:28:03 +02:00 committed by Jakub Jelinek
parent e472d6bf32
commit 1de12eab74
4 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2010-05-10 Jakub Jelinek <jakub@redhat.com>
PR debug/44028
* haifa-sched.c (schedule_insn): When clearing INSN_VAR_LOCATION_LOC,
clear also INSN_REG_USE_LIST.
2010-05-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/mips/mips.c (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Undef.

View File

@ -1695,6 +1695,7 @@ schedule_insn (rtx insn)
sd_iterator_cond (&sd_it, &dep);)
{
rtx dbg = DEP_PRO (dep);
struct reg_use_data *use, *next;
gcc_assert (DEBUG_INSN_P (dbg));
@ -1716,6 +1717,14 @@ schedule_insn (rtx insn)
INSN_VAR_LOCATION_LOC (dbg) = gen_rtx_UNKNOWN_VAR_LOC ();
df_insn_rescan (dbg);
/* Unknown location doesn't use any registers. */
for (use = INSN_REG_USE_LIST (dbg); use != NULL; use = next)
{
next = use->next_insn_use;
free (use);
}
INSN_REG_USE_LIST (dbg) = NULL;
/* We delete rather than resolve these deps, otherwise we
crash in sched_free_deps(), because forward deps are
expected to be released before backward deps. */

View File

@ -1,3 +1,8 @@
2010-05-10 Jakub Jelinek <jakub@redhat.com>
PR debug/44028
* gcc.dg/pr44028.c: New test.
2010-05-08 Daniel Franke <franke.daniel@gmail.com>
PR fortran/27866

View File

@ -0,0 +1,22 @@
/* PR debug/44028 */
/* { dg-do compile } */
/* { dg-options "-O3 -fcompare-debug" } */
/* { dg-options "-O3 -fsched-pressure -fschedule-insns -fcompare-debug" { target i?86-*-* x86_64-*-* } } */
struct S { int val[16]; };
static inline int
bar (struct S x)
{
long double pc = 0;
int i;
for (i = 0; i < 16; i++)
pc += x.val[i];
return pc;
}
int
foo (struct S x)
{
return bar (x);
}