LWN.net Logo

Quotes of the week

Quotes of the week

Posted Aug 23, 2012 19:13 UTC (Thu) by vonbrand (subscriber, #4458)
In reply to: Quotes of the week by cate
Parent article: Quotes of the week

A long time ago, somebody told me there are three types of C compilers: Very smart ones, which disregard register because they do a better job at asigning values to registers than any static "this variable goes into a register" could possibly do; smart ones, which heed the register decoration when they can; and dumb ones which disregard register completely. GCC is one of the smarter ones around...


(Log in to post comments)

register

Posted Aug 25, 2012 0:00 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

"disregard register because ..." sounds to me like it subsumes "disregard register completely." What is the difference between the very smart and dumb compilers?

register

Posted Aug 25, 2012 13:45 UTC (Sat) by mpr22 (subscriber, #60784) [Link]

The dumb one doesn't store variables in registers at all (other than transiently); everything is on the stack, because that's simpler to code the compilation behaviour for.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds