PR tree-optimization/40582
* tree-sra.c (build_ref_for_offset_1): Use types_compatible_p rather
than useless_type_conversion_p.
(generate_subtree_copies): Increment sra_stats.subtree_copies at a
proper place.
* testsuite/gcc.c-torture/compile/pr40582.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149088
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-06-30 Martin Jambor <mjambor@suse.cz>
+ PR tree-optimization/40582
+ * tree-sra.c (build_ref_for_offset_1): Use types_compatible_p rather
+ than useless_type_conversion_p.
+ (generate_subtree_copies): Increment sra_stats.subtree_copies at a
+ proper place.
+
+2009-06-30 Martin Jambor <mjambor@suse.cz>
+
PR middle-end/40554
* tree-sra.c (sra_modify_expr): Add access->offset to start_offset.
+2009-06-30 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/40582
+ * gcc.c-torture/compile/pr40582.c: New test.
+
2009-06-30 Wei Guozhi <carrot@google.com>
PR/40416
--- /dev/null
+struct A
+{
+ void* q;
+ short i;
+};
+
+union U
+{
+ char* p;
+ struct A a;
+};
+
+struct A foo(union U u)
+{
+ struct A a = { 0, 0 };
+ a = u.a;
+ return a;
+}
HOST_WIDE_INT el_size;
if (offset == 0 && exp_type
- && useless_type_conversion_p (exp_type, type))
+ && types_compatible_p (exp_type, type))
return true;
switch (TREE_CODE (type))
insert_after ? GSI_NEW_STMT
: GSI_SAME_STMT);
stmt = gimple_build_assign (expr, repl);
- sra_stats.subtree_copies++;
}
if (insert_after)
else
gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
update_stmt (stmt);
+ sra_stats.subtree_copies++;
}
if (access->first_child)