Newsgroups: | comp.arch,comp.compilers |
From: | yuri@shimari.cmf.nrl.navy.mil (Yuri Trifanov) |
Keywords: | C, optimize |
Organization: | Followers of Vince |
References: | 94-10-108 94-10-156 |
Date: | Mon, 31 Oct 1994 22:27:55 GMT |
Andy Glew <glew@ichips.intel.com> wrote:
}I believe that C's rules about data structure organization are
}obsolete. Certainly, they are not in the ken of the usual programmer
}using C or C++. Why not permit compilers to do such "illegal" data
}structure reorganizations, bringing the performance gains Lebeck and
}Wood describes to the standard application?
and john@iastate.edu (John Hascall) responded
> Perhaps a "struct" should be paddable and/or reorganizable
> and a "packed struct" should not.
one of the problems that this causes is in trying to write code for
networking and other applications where more than one compiler/machine
type will be looking at the same bytes.
since there are other issues involved in these circumstances (such as
byte ordering and floating point format), it seems healthy to separate
those instances where the organization of bytes in memory is
important, as distinct from the compiler trying to provide the best
possible speed for a higher level contruct (member access)
having that distinction recognized by the compiler (as suggested
above) can mean significant savings over the use of an
encoding/decoding library both in function call overhead and inlining
with contextual optimization.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.