+2009-01-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/38503
+ * cfgexpand.c (expand_gimple_basic_block): Ignore
+ GIMPLE_CHANGE_DYNAMIC_TYPE during expansion.
+ * tree-ssa-structalias.c (set_uids_in_ptset): Do not prune
+ variables that cannot have TBAA applied.
+ (compute_points_to_sets): Do not remove GIMPLE_CHANGE_DYNAMIC_TYPE
+ statements.
+
2009-01-27 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/38969
return new_bb;
}
}
- else
+ else if (gimple_code (stmt) != GIMPLE_CHANGE_DYNAMIC_TYPE)
{
tree stmt_tree = gimple_to_tree (stmt);
last = get_last_insn ();
+2009-01-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/38503
+ * g++.dg/warn/Wstrict-aliasing-bogus-placement-new.C: New testcase.
+
2009-01-27 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/38969
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing" } */
+
+inline void *operator new (__SIZE_TYPE__, void *__p) throw() { return __p; }
+
+struct Y {
+ Y() {}
+ int i;
+};
+
+struct X {
+ X() {}
+ void construct(const Y& y)
+ {
+ new (&m_data[0]) Y(y);
+ }
+ bool initialized;
+ char m_data[sizeof (Y)];
+};
+
+void bar(const X&);
+void foo(Y& y)
+{
+ X x;
+ x.construct(y);
+ x.initialized = true;
+ bar(x);
+}
+
type-based pruning disabled. */
if (vi->is_artificial_var
|| !is_derefed
- || no_tbaa_pruning)
+ || no_tbaa_pruning
+ || vi->no_tbaa_pruning)
bitmap_set_bit (into, DECL_UID (vi->decl));
else
{
find_func_aliases (phi);
}
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
- {
- gimple stmt = gsi_stmt (gsi);
-
- find_func_aliases (stmt);
-
- /* The information in GIMPLE_CHANGE_DYNAMIC_TYPE statements
- has now been captured, and we can remove them. */
- if (gimple_code (stmt) == GIMPLE_CHANGE_DYNAMIC_TYPE)
- gsi_remove (&gsi, true);
- else
- gsi_next (&gsi);
- }
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ find_func_aliases (gsi_stmt (gsi));
}