path_var offset_pv
= get_representative_path_var (offset_reg->get_byte_offset (),
visited);
- if (!offset_pv)
+ if (!offset_pv || TREE_CODE (offset_pv.m_tree) != INTEGER_CST)
return path_var (NULL_TREE, 0);
+ tree addr_parent = build1 (ADDR_EXPR,
+ build_pointer_type (reg->get_type ()),
+ parent_pv.m_tree);
return path_var (build2 (MEM_REF,
reg->get_type (),
- parent_pv.m_tree, offset_pv.m_tree),
+ addr_parent, offset_pv.m_tree),
parent_pv.m_stack_depth);
}
--- /dev/null
+/* { dg-additional-options "-O1 -Wno-builtin-declaration-mismatch" } */
+
+int
+l8 (void);
+
+__SIZE_TYPE__
+malloc (__SIZE_TYPE__);
+
+void
+th (int *);
+
+void
+bv (__SIZE_TYPE__ ny)
+{
+ int ***mf;
+
+ while (l8 ())
+ {
+ *mf = 0;
+ (*mf)[ny] = (int *) malloc (sizeof (int));
+ th ((*mf)[ny]); /* { dg-warning "leak" } */
+ }
+}