------- Comment #1 from rguenth at gcc dot gnu dot org 2008-05-01 09:44 ------- GCC 4.3 works for me. I can confirm this with 4.2.3 and 4.1.2.
The problem is we end up with ivtmp.64 = (unsigned int) &foo[0].bar[(unsigned int) i]{lb: 0 sz: 128}.c[0]; (note the element size of 128, which is wrong -- it should be 256). Probably fixed with the gimplify.c/tree-ssa-ccp.c hunks of 2007-04-12 Richard Guenther <[EMAIL PROTECTED]> PR tree-optimization/24689 PR tree-optimization/31307 * fold-const.c (operand_equal_p): Compare INTEGER_CST array indices by value. * gimplify.c (canonicalize_addr_expr): To be consistent with gimplify_compound_lval only set operands two and three of ARRAY_REFs if they are not gimple_min_invariant. This makes it never at this place. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. Yep. I just confirmed that. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Known to fail| |4.2.3 4.1.2 Known to work| |4.0.4 4.3.0 Last reconfirmed|0000-00-00 00:00:00 |2008-05-01 09:44:57 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36093