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

--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> ---
Your test case contains this:

===snip===
struct iphdr
  {
...
  };
...
int main()
{
  char thePacket[1518];
  memset(thePacket, 0, 1518);

  thePacket[30] = 1;
  thePacket[31] = 2;
  thePacket[32] = 3;
  thePacket[33] = 4;

  struct ether_header* theEthHeader = (struct ether_header*)(thePacket);

  struct iphdr* theIpHeader = (struct iphdr*)((const unsigned
char*)(theEthHeader) + 14);

  struct in_addr myInAddr;
  myInAddr.s_addr = theIpHeader->daddr;
===snip===

The alignment of thePacket is arbitrary, so the alignment of theIpHeader is
unknown, and struct iphdr is not declared with attribute packed.  The final
load may therefore be misaligned.

Reply via email to