Commit 71d4d3eb by Martin Jambor Committed by Martin Jambor

re PR tree-optimization/40582 (ice for non-trivial conversion at assignment with -O2)

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.

	* testsuite/gcc.c-torture/compile/pr40582.c: New test.

From-SVN: r149088
parent f57017cd
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
......
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;
}
......@@ -1036,7 +1036,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
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))
......@@ -1760,7 +1760,6 @@ generate_subtree_copies (struct access *access, tree agg,
insert_after ? GSI_NEW_STMT
: GSI_SAME_STMT);
stmt = gimple_build_assign (expr, repl);
sra_stats.subtree_copies++;
}
if (insert_after)
......@@ -1768,6 +1767,7 @@ generate_subtree_copies (struct access *access, tree agg,
else
gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
update_stmt (stmt);
sra_stats.subtree_copies++;
}
if (access->first_child)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment