Mike Stump wrote:
We need to teach it about the meaning of constants.
One can:
#include "foo.h"
main() { printf ("%d\n", offsetof (s, m)); }
and then in another file, read and use that on an address. One can also transform it into a #define S_M_OFFSET 8, and #include it. So, I'd claim the optimizer has to know about constants already.
I fail to see your point, unless it is that whether or not you spell "8" as "8", "&s.x - &s.y", or "offsetof (S, x) - offsetof (S, y)" should not matter, in which case I certainly agree.
-- Mark Mitchell CodeSourcery, LLC [EMAIL PROTECTED] (916) 791-8304