baz (char *a)
{
char b[16] = "abcdefg";
- __builtin_strncpy (a, b, __builtin_strnlen (b, 7)); /* { dg-bogus "specified bound depends on the length of the source argument" } */
+ __builtin_strncpy (a, b, __builtin_strnlen (b, 7)); /* { dg-warning "output truncated before terminating nul" } */
}
void fill (char *);
class strlen_pass : public dom_walker
{
public:
- strlen_pass (cdi_direction direction)
+ strlen_pass (function *fun, cdi_direction direction)
: dom_walker (direction),
- ptr_qry (&m_ranger),
+ ptr_qry (get_range_query (fun)),
m_cleanup_cfg (false)
{
}
unsigned HOST_WIDE_INT lenrng[2],
unsigned HOST_WIDE_INT *size, bool *nulterm);
- gimple_ranger m_ranger;
-
/* A pointer_query object to store information about pointers and
their targets in. */
pointer_query ptr_qry;
ssa_ver_to_stridx.safe_grow_cleared (num_ssa_names, true);
max_stridx = 1;
+ enable_ranger (fun);
/* String length optimization is implemented as a walk of the dominator
tree and a forward walk of statements within each block. */
- strlen_pass walker (CDI_DOMINATORS);
+ strlen_pass walker (fun, CDI_DOMINATORS);
walker.walk (ENTRY_BLOCK_PTR_FOR_FN (fun));
if (dump_file && (dump_flags & TDF_DETAILS))
strlen_to_stridx = NULL;
}
+ disable_ranger (fun);
scev_finalize ();
loop_optimizer_finalize ();