(This patch is for the "asan" branch.) 2012-11-10 Tobias Burnus Jakub Jelinek * asan.c (maybe_instrument_builtin_call): Set *iter to gsi for the call at the end. (transform_statements): Leave loop when gsi_end_p. diff --git a/gcc/asan.c b/gcc/asan.c index 155e84b..f5e357a 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1187,14 +1187,15 @@ maybe_instrument_builtin_call (gimple_stmt_iterator *iter) loc, /*is_store=*/false); if (source1 != NULL_TREE) instrument_mem_region_access (source1, len, iter, loc, /*is_store=*/false); else if (dest != NULL_TREE) instrument_mem_region_access (dest, len, iter, loc, /*is_store=*/true); + *iter = gsi_for_stmt (call); return true; } return false; } /* Instrument the assignment statement ITER if it is subject to instrumentation. */ @@ -1243,14 +1244,16 @@ transform_statements (void) { gimple s = gsi_stmt (i); if (gimple_assign_single_p (s)) instrument_assignment (&i); else if (is_gimple_call (s)) maybe_instrument_call (&i); + if (gsi_end_p (i)) + break; } } } /* Build struct __asan_global {