http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45967
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2010.10.11 15:03:59 AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Target Milestone|--- |4.5.2 Summary|gcc-4.5.x optimizes code |[4.5/4.6 Regression] |with side-effects away |gcc-4.5.x optimizes code | |with side-effects away Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-10-11 15:03:59 UTC --- I think I have seen a dup of this bug. The bug is in points-to analysis which doesn't grok your weird way of initializing a pointer temporary. So what goes on is that you have int *pointer; initialize-pointer-by-pieces --*pointer; and points-to analysis doesn't get that initialize-pointer-by-pieces alters the points-to set of pointer and thus we end up with pointer pointing to nothing (which makes --*pointer removed by dead code elimination). The bug is also latent in 4.4 but there for a pointer that points to nothing we simply assume it points to anything (which hides bugs). PR45623 was similar, but I am thinking of another dup. I will give this mess a little more thought.