------- Comment #6 from pinskia at gcc dot gnu dot org  2008-12-20 18:58 -------
(In reply to comment #5)
> Actually that is an aliasing violation still as you still accessing *p, yes it
> looks like it is not an access because of the address but you are still
> accessing *p really.

Oh and we do create a VCE for that case already:
  return VIEW_CONVERT_EXPR<int>(a->a);

Yes we thought about this when I was writing the original code which created
the VCE.  If it was just (float*)p, there would be no aliasing violation but
the access happens even if memory is not really accessed.  The address
expression still does not cause no access to happen, this is why doing
(int)(&((struct f*)(0))->a) is still undefined code as there is an access to a
NULL pointer (even if we supported this access).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38486

Reply via email to