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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/05/08 19:11
Modified:
  05/05/08 19:58

Read: times


 
#154443 - Compiler-independent efficient C
Responding to: ???'s previous message
Erik said:
do recall some long ago doing checks of a) and b) where b), indeed, "made it easier for the compiler" what they were is long forgotten

Sure. With a compiler that's not too bright about optimization, you could/can help things along with simple tricks like changing (a * 8) to (a << 3), or removing unvarying calculations from loops. But as compilers get better and better, those tricks have less and less value because the compiler does those things for you anyway, regardless of how you write your program.

Erik said:
so, maybe we should forget about the compilers involvement and just continue with "compiler independent efficient C"

But what does that mean? Is there any such thing? Do you really mean "compiler dependent efficient C"?

After trying and failing to come up with some illustrative examples, I'm starting to think that "compiler independent efficient C" is just "C", and that the success of any attempt you make to write in a way that improves the generated code is going to depend on which compiler you're using.

-- Russ


List of 20 messages in thread
TopicAuthorDate
"Real C" vs '51 C            01/01/70 00:00      
   there is nothing wrong except...            01/01/70 00:00      
      if you are not , why are you even here            01/01/70 00:00      
         *(buffer+8+index)?            01/01/70 00:00      
            none of the above            01/01/70 00:00      
               OK then how?            01/01/70 00:00      
   like this            01/01/70 00:00      
      but it's basically the same...            01/01/70 00:00      
      YCMV            01/01/70 00:00      
      No            01/01/70 00:00      
         assumptions            01/01/70 00:00      
            Re: assumptions            01/01/70 00:00      
               I took a \'known\' example            01/01/70 00:00      
                  Compiler-independent efficient C            01/01/70 00:00      
                     a clarification and an example            01/01/70 00:00      
                        Two kinds of "efficiency"            01/01/70 00:00      
                     Compiler smarter than coder            01/01/70 00:00      
                        Getting the least out of your compiler            01/01/70 00:00      
   Real C is inherently reentrant            01/01/70 00:00      
      which, even when possible, often is ill advised            01/01/70 00:00      

Back to Subject List