------- Comment #4 from rguenth at gcc dot gnu dot org 2008-12-12 10:11 ------- Yes. Though you have to be careful not to create false positives for
float f; struct X { int i; }; struct X *p = (struct X *)&f; float *q = (float *)&p->i; return *q; if the code is obfuscated enough that the definition of p is not visible. Or, one could even say that creating VIEW_CONVERT_EXPR <float> (p->i) is an invalid transformation and causes an alias violation. Do we do this transformation in this case? I think we should avoid doing it here (that is, whenever the expression we view-convert contains a pointer dereference). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38486