This is the mail archive of the gcc@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] | |
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.
-- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |