This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3 PATCH RFA]: Patch for packed structures on 3.3 branch (PR middle-end/16038)
- From: "Gabriel Dos Reis" <gdr at acm dot org>
- To: "Ian Lance Taylor" <ian at wasabisystems dot com>
- Cc: gcc-patches at gcc dot gnu dot org,"Gabriel Dos Reis" <gdr at integrable-solutions dot net>
- Date: Fri, 18 Jun 2004 19:04:55 +0200 (CEST)
- Subject: Re: [3.3 PATCH RFA]: Patch for packed structures on 3.3 branch (PR middle-end/16038)
- References: <20040617200452.26923.qmail@gossamer.airs.com>
- Reply-to: gdr at acm dot org
You Wrote Ian Lance Taylor
> This test case fails for the mips-elf target on 3.3 with -O:
>
> struct in_addr {
> unsigned int s_addr;
> } __attribute__((__packed__));
> struct MemberInfo_t {
> char membername[1];
> struct in_addr ipaddrs[3];
> };
> extern void bar (struct in_addr);
> void foo(struct MemberInfo_t *p)
> {
> unsigned int i;
> for (i = 0; i < 3; i++)
> if (p->ipaddrs[i].s_addr != 0)
> bar(p->ipaddrs[i]);
> }
>
> It generates an illegal unaligned access. See PR middle-end/16038 for
> the details.
>
> The code works in 3.4. This patch fixes the problem in 3.3.
>
> OK for the 3.3 branch for inclusion in 3.3.5?
Yes. Thanks.