diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-04-08 11:16:28 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-04-08 11:16:28 +0200 |
commit | aa847cc8ec88e3eb7f6671ad9ea1988ae3d7edbf (patch) | |
tree | f638eb80b05abfc09514aa002cdf9ab96e266514 /gcc/cfgexpand.c | |
parent | 1dcc82c2c7975d324ad401dc0797eb15463ce53e (diff) | |
download | gcc-aa847cc8ec88e3eb7f6671ad9ea1988ae3d7edbf.zip gcc-aa847cc8ec88e3eb7f6671ad9ea1988ae3d7edbf.tar.gz gcc-aa847cc8ec88e3eb7f6671ad9ea1988ae3d7edbf.tar.bz2 |
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
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index eeb5c73..bff4897 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2502,7 +2502,8 @@ expand_debug_expr (tree exp) { enum machine_mode addrmode, offmode; - gcc_assert (MEM_P (op0)); + if (!MEM_P (op0)) + return NULL; op0 = XEXP (op0, 0); addrmode = GET_MODE (op0); @@ -3623,7 +3624,8 @@ discover_nonconstant_array_refs (void) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&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); } } |