Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/27/12 13:25
Read: times


 
Msg Score: +1
 +1 Informative
#187553 - Getting the least out of your compiler
Responding to: ???'s previous message
Getting the Least Out of Your C Compiler
Class #508, Embedded Systems Conference San Francisco 2001
Jakob Engblom, IAR Systems


"This article discusses how to help a modern, highly optimizing C compiler generate small code, while maintaining the portability and readability advantages offered by C. In order to facilitate an understanding of what a compiler likes and does not like, we will give an inside view on how a compiler operates.
Many established truths and tricks are invalidated when using modern compilers. We will demonstrate some of the more common mistakes and how to avoid them, and give a catalog of good coding techniques. An important conclusion is that code that is easy for a human to understand is usually also compiler friendly, contrary to hacker tradition."

(my emphasis)

http://www.engbloms.se/publicati...f-2001.pdf

This article references the above, and some other books that you might want to look into... http://jakob.engbloms.se/archives/750


You should also check your particular compiler Documentation - including tech support articles, App Notes, etc - for specific advice.
eg, in the case of Keil C51, see: http://www.keil.com/support/m...c51_xc.htm


List of 33 messages in thread
TopicAuthorDate
Where can one learn Intermediate C techniques for 8051            01/01/70 00:00      
   on the right track            01/01/70 00:00      
      one more thing            01/01/70 00:00      
         Not uncommon bid bad coding standards to comply with            01/01/70 00:00      
         Not afraid of globals, but...            01/01/70 00:00      
   More keil optimizer interesting tidbits            01/01/70 00:00      
      optimization            01/01/70 00:00      
      nothing gained, nothing lost            01/01/70 00:00      
         I don't            01/01/70 00:00      
            you can do both            01/01/70 00:00      
               That is not helping the compiler            01/01/70 00:00      
                  exact same            01/01/70 00:00      
                     Technically, they are not the same            01/01/70 00:00      
                        Hmmm...            01/01/70 00:00      
                        C don't do full evaluation of logical expressions            01/01/70 00:00      
                           In discrete mathematics proving one is not a proof            01/01/70 00:00      
                              Lazy evaluation demanded            01/01/70 00:00      
                                 I have learned something new because of this            01/01/70 00:00      
                                    me too            01/01/70 00:00      
                                       Very Important            01/01/70 00:00      
                              Breaks.            01/01/70 00:00      
                                 Compile the code            01/01/70 00:00      
                                    To be more exact            01/01/70 00:00      
                                       Stop It!!            01/01/70 00:00      
                                          That is exactly what I intended            01/01/70 00:00      
                                             Switch Break.            01/01/70 00:00      
               obfusciating code to help the compiler is a VERY bad idea            01/01/70 00:00      
                  the source of this            01/01/70 00:00      
   Where can one learn Intermediate C techniques for 8051            01/01/70 00:00      
   Getting the least out of your compiler            01/01/70 00:00      
      Maybe IAR should follow their own advice?            01/01/70 00:00      
         provided the case ...            01/01/70 00:00      
            Compilers not knowing the target chip.            01/01/70 00:00      

Back to Subject List