[Bug c/18287] Unaligned access to fields inside packed records

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Jan 2 11:12:00 GMT 2005


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-01-02 11:11 -------
.t03.generic is already wrong:

Clobber_Hour_Of (dt)
{
  struct Time_T * D.1122;

  D.1122 = &dt->Time;
  Assign_Hour_Of (D.1122);
}

struct Time_T is 32-bit aligned so D.1122 must be a multiple of 4; as such, it
cannot be assigned &dt->Time which is not a multiple of 4.  A properly aligned
temporary should be created instead and its address assigned to D.1122.


-- 


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



More information about the Gcc-bugs mailing list