{"thread":{"id":"309","subject":"Re: [PATCH GIT 0.6] make use of register variables & size_t","startedAt":"2005-04-25T17:51:14Z","lastAt":"2005-04-25T17:51:14Z","messageCount":1,"participants":["Horst von Brand"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1631","messageId":"200504251751.j3PHpE7T004422@laptop11.inf.utfsm.cl","threadId":"309","inReplyTo":"matthias.christian@tiscali.de","subject":"Re: [PATCH GIT 0.6] make use of register variables & size_t","fromName":"Horst von Brand","fromEmail":"vonbrand@inf.utfsm.cl","sentAt":"2005-04-25T17:51:14Z","receivedAt":"2005-04-25T17:51:14Z","isPatch":true,"sender":{"key":"vonbrand@inf.utfsm.cl","avatar":"https://avatars.githubusercontent.com/u/211384?v=4"},"body":"Matthias-Christian Ott <matthias.christian@tiscali.de> said:\n> [Proposed patch adding \"register\" snipped]\n\nSomebody a long while ago told me there are 3 kinds of C compilers with\nrespect \"register\": Dumb ones (they don't even consider it, just do\nbusiness as usual, as they don't know any better), normal ones (they\nconsider \"register\" and honor it if they can), and bright ones (they don't\neven consider it, as they do a much better job using registers than any\nprogrammer could direct them to by wiring a value into a register). GCC\ndefinitely falls on the brighter side, at least if you tell it to\noptimize. I think \"register\" should be marked deprecated in C (and there\nare few good texts that even mention the word today, so it is deprecated in\npractice).\n\nBetter compare the code produced (with -S instead of -c you'll get\nassembler output in .s, not object code in .o) before any optimization\nproposal. But also consider that large real gains come from higher-level\nchanges (better data structures, more efficient algorithms) and not from\nlow-level changes (In any case, today's compilers are usually smart enough\nto make low-level changes on their own, so you can (thankfully) concentrate\non writing clear, correct code; and let the compiler make it fast. Sure,\nwhere it is in a stretch of hot code, executed hundereds of times a second\non millions of machines worldwide, extra loving care is warranted, but that\nis another kettle of fish.).\n-- \nDr. Horst H. von Brand                   User #22616 counter.li.org\nDepartamento de Informatica                     Fono: +56 32 654431\nUniversidad Tecnica Federico Santa Maria              +56 32 654239\nCasilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513\n"}]}