re PR tree-optimization/42685 ("-fcompare-debug failure" with "-O1 -funroll-loops" (2))

2010-01-26  Richard Guenther  <rguenther@suse.de>

	PR rtl-optimization/42685
	* web.c (web_main): Ignore DEBUG_INSNs.

	* gcc.dg/pr42685.c: New testcase.
	* g++.dg/other/pr42685.C: Likewise.

From-SVN: r156252
This commit is contained in:
Richard Guenther 2010-01-26 16:27:34 +00:00 committed by Richard Biener
parent 7a241624f2
commit 0d9b0371e8
5 changed files with 46 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2010-01-26 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/42685
* web.c (web_main): Ignore DEBUG_INSNs.
2010-01-26 Joern Rennecke <amylaar@spamcop.net>
* doc/tm.texi (TARGET_HANDLE_C_OPTION): Explain arguments.

View file

@ -1,3 +1,9 @@
2010-01-26 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/42685
* gcc.dg/pr42685.c: New testcase.
* g++.dg/other/pr42685.C: Likewise.
2010-01-26 Richard Guenther <rguenther@suse.de>
PR middle-end/42806

View file

@ -0,0 +1,10 @@
// { dg-do compile }
// { dg-options "-O -funroll-loops -fcompare-debug" }
void Remap(int n, int *src, int *dst, int *map)
{
do {
int i = *src;
if (i != 0) *dst = map[i];
} while (--n != 0);
}

View file

@ -0,0 +1,22 @@
/* { dg-do compile } */
/* { dg-options "-O -funroll-loops -fcompare-debug" } */
struct S {
int i;
};
extern void baz(int);
static inline void bar(struct S *s)
{
baz(s->i);
}
void foo(int *w, int cond, struct S *s)
{
int i, n = 0;
while (*w++ != 0) n++;
for (i = 0; i < n; i++)
if (cond == 0)
bar(s + i);
}

View file

@ -298,7 +298,7 @@ web_main (void)
FOR_BB_INSNS (bb, insn)
{
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
if (NONDEBUG_INSN_P (insn))
{
df_ref *use_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
@ -326,7 +326,7 @@ web_main (void)
FOR_BB_INSNS (bb, insn)
{
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
if (NONDEBUG_INSN_P (insn))
{
df_ref *use_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
@ -350,7 +350,7 @@ web_main (void)
FOR_BB_INSNS (bb, insn)
{
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
if (NONDEBUG_INSN_P (insn))
{
df_ref *use_rec;
df_ref *def_rec;