On Mon, Jun 13, 2005 at 08:38:30PM +0200, Leopold Toetsch wrote: > Chip Salzenberg wrote: > >On Mon, Jun 13, 2005 at 07:29:53PM +0200, Leopold Toetsch wrote: > >>The PMC allocation area is a big bunch of memory, where PMC-sized > >>pieces are carved out by the memory allocation system. There is no > >>union or compiler bug involved. > > > >But "PMC-sized" is defined in terms of the C sizeof operator, right? > > Yes. And the size can be 20 or better it is with --optimize on an 32-bit > system, which places every second PMC->num_val on an "odd" boundary.
If architecture X requires N-byte alignment for type T; and any compiler for architecture X defines any structure containing a member of type T as having a total structure size that is not a multiple of N, then that compiler really is buggy. It's an inevitable consequence of how array allocation and pointer arithmetic are defined. Of course, there's more than one definition of "requires" that makes sense. Compilers are allowed to generate slow code, just not broken. AFAIK, Intel doesn't actually require any particular alignment of doubles, but what IK on the subject isn't much. -- Chip Salzenberg <[EMAIL PROTECTED]>