This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, ia64] Fix unaligned accesses on IA64 from dwarf2out.c


On Fri, 2011-08-05 at 11:45 -0700, Richard Henderson wrote:
> On 08/05/2011 10:54 AM, Steve Ellcey wrote:
> > -  unsigned char checksum[16];
> >    struct md5_ctx ctx;
> > +  unsigned char checksum[16];
> 
> How about
> 
>   struct md5_data
>   {
>     struct md5_ctx ctx;
>     unsigned char checksum[16];
>   };
> 
>   struct md5_data md5;
> 
> with the structure definition somewhere interesting?
> If no where else, just dwarf2out.c file scope.
> 
> 
> r~

Oh, so after I declare md5, I call md5_finish_ctx like: 

	md5_finish_ctx (&md5.ctx, md5.checksum);

Is that what you are proposing?  It seems a bit odd to put checksum in a
a structure with ctx just to guarantee its alignment and not to pass
them around as one entity, but I guess it's no worse then using a union.

Steve Ellcey
sje@cup.hp.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]