- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I face a strange problem with gcc that I never faced with other compilers. If for example, I have the following definitions : In an include file : # define BASE 0xF000# define REGISTER BASE + 0x02# define UBYTE unsigned char In a code file : *((UBYTE *)(REGISTER) = 0x00; ... *((UBYTE *)(REGISTER) = 0xFF; When i look at the assembler code, the address is calculated each time (0xF000 + 0x02) instead of being calculated at the compilation time. Although both are literals ... This involves additions, register transfers and is 2-3 times longer than what I can do by hand .. This is very strange as both values are known at compilation time. Even if we use optimisation (-O2 or O3), it does nothing toward an optimisation which is not very difficult to carry out. Did you faced such issues ? Any idea or any optimisation flag to be used that you know about ? With best regards, ThierryLink Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page