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
+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
--- /dev/null
+union bzz
+{
+ unsigned *pa;
+ void *pv;
+};
+
+void foo (void)
+{
+ union bzz u;
+ void **x;
+ void *y = 0;
+ x = &u.pv;
+ *x = y;
+}
&& 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));