re PR debug/80436 (-fcompare-debug failure)

PR debug/80436
	* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.

	* g++.dg/opt/pr80436.C: New test.

From-SVN: r247000
This commit is contained in:
Jakub Jelinek 2017-04-19 18:29:45 +02:00 committed by Jakub Jelinek
parent 6a8446fa8b
commit 48d811eb1c
4 changed files with 55 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2017-04-19 Jakub Jelinek <jakub@redhat.com>
PR debug/80436
* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.
2017-04-19 Georg-Johann Lay <avr@gjlay.de>
PR target/80462

View File

@ -1,3 +1,8 @@
2017-04-19 Jakub Jelinek <jakub@redhat.com>
PR debug/80436
* g++.dg/opt/pr80436.C: New test.
2017-04-19 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/torture/pr80341.c: Require int32plus.

View File

@ -0,0 +1,42 @@
// PR debug/80436
// { dg-do compile { target c++11 } }
// { dg-options "-O3 -fcompare-debug" }
void fn (...);
void foo (int, int, int);
struct { int elt1; int bits; } *a;
int b, d;
int
bar (unsigned *x)
{
if (0)
next_bit:
return 1;
while (1)
{
if (b)
if (a->bits)
goto next_bit;
*x = b;
if (a->elt1)
return 0;
a = 0;
}
}
enum { C0, C1 } *c;
void
baz ()
{
int e, m = d;
for (; e < m; e++)
{
if (e < 0)
foo (0, 0, c[e]);
unsigned f;
for (; bar (&f);)
fn (f);
}
}

View File

@ -494,6 +494,9 @@ find_uses_to_rename_def (tree def, bitmap *use_blocks, bitmap need_phis)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
{
if (is_gimple_debug (use_stmt))
continue;
basic_block use_bb = gimple_bb (use_stmt);
use_operand_p use_p;