Commit 5db959b6 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/42730 (ice: verify_stmts failed)

2010-01-13  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/42730
	* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Add shortcut for
	offset zero.

	* gcc.c-torture/compile/pr42730.c: New testcase.

From-SVN: r155872
parent 30c73d1a
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42730
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Add shortcut for
offset zero.
2010-01-13 Steve Ellcey <sje@cup.hp.com>
PR target/pr42542
......
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42730
* gcc.c-torture/compile/pr42730.c: New testcase.
2010-01-13 Steve Ellcey <sje@cup.hp.com>
PR target/pr42542
......
union bzz
{
unsigned *pa;
void *pv;
};
void foo (void)
{
union bzz u;
void **x;
void *y = 0;
x = &u.pv;
*x = y;
}
......@@ -2120,6 +2120,10 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset)
&& is_gimple_min_invariant (DECL_INITIAL (base)))
return DECL_INITIAL (base);
/* If there is no offset involved simply return the folded base. */
if (integer_zerop (offset))
return base;
/* Try folding *(&B+O) to B.X. */
t = maybe_fold_offset_to_reference (loc, base_addr, offset,
TREE_TYPE (expr));
......
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