This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR other/13906 (md5.c does unaligned memory accesses)
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: dj at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Jul 2005 15:36:54 -0700 (PDT)
- Subject: Re: Patch for PR other/13906 (md5.c does unaligned memory accesses)
> > + # define ATTRIBUTE_ALIGNED_ALIGNOF(m)
> > + # endif /* GNUC >= 3.3 */
>
> The above comment is wrong.
OK, that is easy to fix.
> > --- 80,86 ----
> >
> > md5_uint32 total[2];
> > md5_uint32 buflen;
> > ! char buffer[128] ATTRIBUTE_ALIGNED_ALIGNOF(md5_uint32);
> > };
>
> How can buffer ever *not* be as aligned as an md5_uint32, when it
> follows one in the structure?
Well, if the alignment of the md5_uint32 type was greater than the size
of the md5_uint32 type, then buffer wouldn't necessarily have to have
the same alignment. I doubt there are any real platforms with this
situation.
Steve Ellcey
sje@cup.hp.com