Commit aa847cc8 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/43670 ("-fcompare-debug failure (length)" with -O -ftree-vrp)

	PR debug/43670
	* cfgexpand.c (expand_debug_expr): If for non-NULL offset
	op0 is not a MEM, just return NULL instead of assertion
	failure.
	(discover_nonconstant_array_refs): Don't walk debug stmts.

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

From-SVN: r158108
parent 1dcc82c2
2010-04-08 Jakub Jelinek <jakub@redhat.com>
PR debug/43670
* cfgexpand.c (expand_debug_expr): If for non-NULL offset
op0 is not a MEM, just return NULL instead of assertion
failure.
(discover_nonconstant_array_refs): Don't walk debug stmts.
2010-04-08 Doug Kwan <dougkwan@google.com> 2010-04-08 Doug Kwan <dougkwan@google.com>
* configure.ac: Recognize gold and do not use its version number * configure.ac: Recognize gold and do not use its version number
......
...@@ -2502,7 +2502,8 @@ expand_debug_expr (tree exp) ...@@ -2502,7 +2502,8 @@ expand_debug_expr (tree exp)
{ {
enum machine_mode addrmode, offmode; enum machine_mode addrmode, offmode;
gcc_assert (MEM_P (op0)); if (!MEM_P (op0))
return NULL;
op0 = XEXP (op0, 0); op0 = XEXP (op0, 0);
addrmode = GET_MODE (op0); addrmode = GET_MODE (op0);
...@@ -3623,7 +3624,8 @@ discover_nonconstant_array_refs (void) ...@@ -3623,7 +3624,8 @@ discover_nonconstant_array_refs (void)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{ {
gimple stmt = gsi_stmt (gsi); gimple stmt = gsi_stmt (gsi);
walk_gimple_op (stmt, discover_nonconstant_array_refs_r, NULL); if (!is_gimple_debug (stmt))
walk_gimple_op (stmt, discover_nonconstant_array_refs_r, NULL);
} }
} }
......
2010-04-08 Jakub Jelinek <jakub@redhat.com>
PR debug/43670
* gcc.dg/pr43670.c: New test.
2010-04-08 Maxim Kuvyrkov <maxim@codesourcery.com> 2010-04-08 Maxim Kuvyrkov <maxim@codesourcery.com>
PR middle-end/40815 PR middle-end/40815
......
/* PR debug/43670 */
/* { dg-do compile } */
/* { dg-options "-O -ftree-vrp -fcompare-debug" } */
extern void abort (void);
typedef struct { double T1; } S;
void
foo (void)
{
int i, j;
double s;
S y[2][2];
S *x[2] = { y[0], y[1] };
S **p = x;
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
p[j][i].T1 = 1;
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
s = p[j][i].T1;
if (s != 1)
abort ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment