<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Is GCC a &#039;good&#039; compiler?</title>
	<atom:link href="http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/</link>
	<description>Thoughts on embedded systems by Nigel Jones</description>
	<lastBuildDate>Mon, 06 Sep 2010 14:57:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ashleigh</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-1614</link>
		<dc:creator>Ashleigh</dc:creator>
		<pubDate>Wed, 18 Aug 2010 00:11:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-1614</guid>
		<description>Nigel - your comment about is spot on. First thing I do with any new compiler or tool chain is RTFM.

So many of my colleagues dont (and never have, over the years) and it makes my almost cry with frustration. The GUI era has made things even worse, people think they dont NEED to read because the GUI saves them the effort.

And then... there are those who insist on always building a product using the GUI but forget or don&#039;t know how to check all the GUI config files into version control - and then when they change you can&#039;t see what that changes were. These days I build EVERYTHING using batch or make files because its 100% repeatable and not prone to accidentally clicking some change of option - and then discovering the mistake 3 months after shipping. (And no, the &quot;debug / release&quot; options in GUIs don&#039;t cut the mustard either!)

Having used GCC for years on Sun workstations and  PCs - it has its place. But for deep embedded micros I&#039;ve been pretty underwhelmed; and recently by the poor optimisers for at least some micros. If code size matters, then spending a day or 2 doing compiler benchmarking really pays off.

Example: If I need to ship a product on a bigger micro, and that bigger micro costs $0.20 more, and I can ship (say) 50,000 products / year then that bigger micro costs $10,000 (per year). If I spend a couple of days of my time it costs (say) $1000, and if I then buy a professional compiler at $5000, I&#039;m still $4000 ahead at the end of my first year. Or the economic payback period is about 8 months. Now ANY businessman will take you up on an investment opportunity like that.</description>
		<content:encoded><![CDATA[<p>Nigel &#8211; your comment about is spot on. First thing I do with any new compiler or tool chain is RTFM.</p>
<p>So many of my colleagues dont (and never have, over the years) and it makes my almost cry with frustration. The GUI era has made things even worse, people think they dont NEED to read because the GUI saves them the effort.</p>
<p>And then&#8230; there are those who insist on always building a product using the GUI but forget or don&#8217;t know how to check all the GUI config files into version control &#8211; and then when they change you can&#8217;t see what that changes were. These days I build EVERYTHING using batch or make files because its 100% repeatable and not prone to accidentally clicking some change of option &#8211; and then discovering the mistake 3 months after shipping. (And no, the &#8220;debug / release&#8221; options in GUIs don&#8217;t cut the mustard either!)</p>
<p>Having used GCC for years on Sun workstations and  PCs &#8211; it has its place. But for deep embedded micros I&#8217;ve been pretty underwhelmed; and recently by the poor optimisers for at least some micros. If code size matters, then spending a day or 2 doing compiler benchmarking really pays off.</p>
<p>Example: If I need to ship a product on a bigger micro, and that bigger micro costs $0.20 more, and I can ship (say) 50,000 products / year then that bigger micro costs $10,000 (per year). If I spend a couple of days of my time it costs (say) $1000, and if I then buy a professional compiler at $5000, I&#8217;m still $4000 ahead at the end of my first year. Or the economic payback period is about 8 months. Now ANY businessman will take you up on an investment opportunity like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-528</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Sun, 28 Mar 2010 14:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-528</guid>
		<description>Great observation! I agree wholeheartedly that not knowing the tool inside out is a productivity stopper - which explains in part why I read compiler manuals so much! I think as a consultant, my situation is a little different in that the nature of the job requires me to switch tools at a higher frequency than a normal gainfully employed engineer. Notwithstanding this I&#039;ve come across plenty of engineers that have never cracked open the reference manual for their tool chain - and thus wonder why they can&#039;t get things done.</description>
		<content:encoded><![CDATA[<p>Great observation! I agree wholeheartedly that not knowing the tool inside out is a productivity stopper &#8211; which explains in part why I read compiler manuals so much! I think as a consultant, my situation is a little different in that the nature of the job requires me to switch tools at a higher frequency than a normal gainfully employed engineer. Notwithstanding this I&#8217;ve come across plenty of engineers that have never cracked open the reference manual for their tool chain &#8211; and thus wonder why they can&#8217;t get things done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GroovyD</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-522</link>
		<dc:creator>GroovyD</dc:creator>
		<pubDate>Sun, 28 Mar 2010 04:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-522</guid>
		<description>I have used both free and paid compilers and can say that encountering bugs in the tool chain are the rarest of problems and occur if not equally then even more often on paid tool chains than free ones as less people use the paid tool chains.  

I do agree that in the extremely rare event (it only happened two or perhaps three times for me in over 20 years of embedded programming) you happen across a tool chain bug some good real support would make a world of difference; but the honest truth is once you have identified the problem enough to realize it is in the tool and not your code it is often far easier to just work around it with some creative coding than wait for someone&#039;s support.

The true productivity stopper I have found is not in which tool is being used but simply not knowing enough about the tool you are using (ie. which linker option or pragma does what).  Pick your tools out of a hat;  whichever they might be, and really learn to use them and you will undoubtably be most productive with those tools.  Another productivity stopper is trying some fancy abstraction around coding something that should really be done in a much simpler way.</description>
		<content:encoded><![CDATA[<p>I have used both free and paid compilers and can say that encountering bugs in the tool chain are the rarest of problems and occur if not equally then even more often on paid tool chains than free ones as less people use the paid tool chains.  </p>
<p>I do agree that in the extremely rare event (it only happened two or perhaps three times for me in over 20 years of embedded programming) you happen across a tool chain bug some good real support would make a world of difference; but the honest truth is once you have identified the problem enough to realize it is in the tool and not your code it is often far easier to just work around it with some creative coding than wait for someone&#8217;s support.</p>
<p>The true productivity stopper I have found is not in which tool is being used but simply not knowing enough about the tool you are using (ie. which linker option or pragma does what).  Pick your tools out of a hat;  whichever they might be, and really learn to use them and you will undoubtably be most productive with those tools.  Another productivity stopper is trying some fancy abstraction around coding something that should really be done in a much simpler way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ferdi Pienaar</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-400</link>
		<dc:creator>Ferdi Pienaar</dc:creator>
		<pubDate>Sat, 06 Feb 2010 01:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-400</guid>
		<description>Nigel, as a regular reader there&#039;s an aspect of compilers I&#039;ve been hoping to read something about on your blog -- ROMability of data.  I think it&#039;s probably more of an issue for C++ than C, where, if a const structure is initialized statically, the compiler will place it in ROM (although even C compilers differ in how good they are at doing this -- I recall a compiler for the AVR that required the programmer to use special key-words).For C++, the rules are a little more arcane (aren&#039;t they always?), and whether an instance of a class will be placed in ROM depends on other factors (does the class have user-defined constructors?  Does it have virtual methods?).  It depends on the compiler&#039;s ability to detect that the memory contents could be initialized at compile-time.As an exercise, I&#039;m implementing in C++ a module I developed in C for a previous employer.  I certainly feel the C++ code is more readable and maintainable.  However, if the constant data is not placed in ROM, the module would not be usable on a small embedded device, and the advantages of using C++ would become irrelevant.The ISO&#039;s Technical Report on C++ Performance has something to say about this, but, unsurprisingly, it seems to boil down to, &quot;it depends on the compiler&#039;s ability to do static analysis&quot;.</description>
		<content:encoded><![CDATA[<p>Nigel, as a regular reader there&#39;s an aspect of compilers I&#39;ve been hoping to read something about on your blog &#8212; ROMability of data.  I think it&#39;s probably more of an issue for C++ than C, where, if a const structure is initialized statically, the compiler will place it in ROM (although even C compilers differ in how good they are at doing this &#8212; I recall a compiler for the AVR that required the programmer to use special key-words).For C++, the rules are a little more arcane (aren&#39;t they always?), and whether an instance of a class will be placed in ROM depends on other factors (does the class have user-defined constructors?  Does it have virtual methods?).  It depends on the compiler&#39;s ability to detect that the memory contents could be initialized at compile-time.As an exercise, I&#39;m implementing in C++ a module I developed in C for a previous employer.  I certainly feel the C++ code is more readable and maintainable.  However, if the constant data is not placed in ROM, the module would not be usable on a small embedded device, and the advantages of using C++ would become irrelevant.The ISO&#39;s Technical Report on C++ Performance has something to say about this, but, unsurprisingly, it seems to boil down to, &quot;it depends on the compiler&#39;s ability to do static analysis&quot;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Walrus</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-399</link>
		<dc:creator>The Walrus</dc:creator>
		<pubDate>Fri, 05 Feb 2010 11:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-399</guid>
		<description>I&#039;ve also been around this for a long, long time. The first compiler trouble you have costs a packet. A day spent messing about trying to get the linker to work, or to declare in interrupt handler in this wesks version of gcc.... and you&#039;ve just blown the cost of buying a full on compiler - even ignoring the support issues. (I&#039;ve found compiler bugs in some of the expensive compilers as well - but I got them fixed pretty damn quick by the vendors!)Paying money for a reputable compiler is simply, in most cases, a good business practice. Few engineers work out the cost of their own time. They should. It changes the approach you take to compilers, and many other things as well.</description>
		<content:encoded><![CDATA[<p>I&#39;ve also been around this for a long, long time. The first compiler trouble you have costs a packet. A day spent messing about trying to get the linker to work, or to declare in interrupt handler in this wesks version of gcc&#8230;. and you&#39;ve just blown the cost of buying a full on compiler &#8211; even ignoring the support issues. (I&#39;ve found compiler bugs in some of the expensive compilers as well &#8211; but I got them fixed pretty damn quick by the vendors!)Paying money for a reputable compiler is simply, in most cases, a good business practice. Few engineers work out the cost of their own time. They should. It changes the approach you take to compilers, and many other things as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M. Eric Carr</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-398</link>
		<dc:creator>M. Eric Carr</dc:creator>
		<pubDate>Wed, 03 Feb 2010 17:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-398</guid>
		<description>Interesting perspective. As a relatively inexperienced embedded developer, I&#039;m still very much in the bang-for-the-buck category (free being the usual goal), and have yet to come across too many gnarly compiler-related issues -- although I have no doubt they are out there. I can see where using a well-supported compiler could be cost-effective, though. Thanks for the article.</description>
		<content:encoded><![CDATA[<p>Interesting perspective. As a relatively inexperienced embedded developer, I&#39;m still very much in the bang-for-the-buck category (free being the usual goal), and have yet to come across too many gnarly compiler-related issues &#8212; although I have no doubt they are out there. I can see where using a well-supported compiler could be cost-effective, though. Thanks for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-397</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 03 Feb 2010 16:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-397</guid>
		<description>Peter,I think you need to give us some examples of consultancies supporting their own tool chains. At least if we are talking about C/C++ compilers for CPU&#039;s at the deeply embedded end of things...Sure, there are a number of highflying consultancies/service companies with their own proprietary compiler/language tools but then we are talking about x86 or other server/workstation type CPU&#039;s as the target architecture.There are a number of companies maintaining their own ports of GCC for a few selected CPU&#039;s, but in the end they are just as dependent on the open source community as the ordinary developer if they want to stay reasonably in synch with main line development.It&#039;s *very* expensive to develop and maintain, not to mention supporting, compiler tools for multiple CPU architectures, which is why there are so few companies out there doing this. (It&#039;s even expensive to do it for only one architecture if you for example look at ARM.)There is simply no business even for the most pricey consultanices in developing and maintaining their own AVR, msp430 or m16c compiler for example, because that would imply steering all projects towards that architecture. (Again, x86 etc are a completely different thing.)So, I&#039;m really very interested in hearing about counter examples to what I state above!</description>
		<content:encoded><![CDATA[<p>Peter,I think you need to give us some examples of consultancies supporting their own tool chains. At least if we are talking about C/C++ compilers for CPU&#39;s at the deeply embedded end of things&#8230;Sure, there are a number of highflying consultancies/service companies with their own proprietary compiler/language tools but then we are talking about x86 or other server/workstation type CPU&#39;s as the target architecture.There are a number of companies maintaining their own ports of GCC for a few selected CPU&#39;s, but in the end they are just as dependent on the open source community as the ordinary developer if they want to stay reasonably in synch with main line development.It&#39;s *very* expensive to develop and maintain, not to mention supporting, compiler tools for multiple CPU architectures, which is why there are so few companies out there doing this. (It&#39;s even expensive to do it for only one architecture if you for example look at ARM.)There is simply no business even for the most pricey consultanices in developing and maintaining their own AVR, msp430 or m16c compiler for example, because that would imply steering all projects towards that architecture. (Again, x86 etc are a completely different thing.)So, I&#39;m really very interested in hearing about counter examples to what I state above!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Bostian</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-396</link>
		<dc:creator>Kyle Bostian</dc:creator>
		<pubDate>Wed, 03 Feb 2010 15:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-396</guid>
		<description>Reading my comment after posting, I wanted to clarify that it isn&#039;t intended as a criticism in any way.  What I&#039;m trying to say is, that the more expensive tools gave us a product we can maintain ourselves.</description>
		<content:encoded><![CDATA[<p>Reading my comment after posting, I wanted to clarify that it isn&#39;t intended as a criticism in any way.  What I&#39;m trying to say is, that the more expensive tools gave us a product we can maintain ourselves.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Bostian</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-395</link>
		<dc:creator>Kyle Bostian</dc:creator>
		<pubDate>Wed, 03 Feb 2010 15:33:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-395</guid>
		<description>Peter, our company has two embedded products that implement complex state machines developed by Nigel.  One was developed with about $8K worth of IAR tools (compiler + Visual State.)  When I need to make a change to that product, I fire up the tools, make my revisions, test them, and ship them.The other was developed with a popular free assembler.  I&#039;ve read the code, and I think I understand it.  That being said, I won&#039;t touch that code with a ten foot pole - it works and the risk of introducing a bug it too high.  This is one of the motivations for development of the former product.       My anecdote is probably more a testament to the power of statecharting tools than it is about the rest of the toolchain.  Nevertheless, when the right tools are used, the tools are well worth it.  (Nigel is as well.)</description>
		<content:encoded><![CDATA[<p>Peter, our company has two embedded products that implement complex state machines developed by Nigel.  One was developed with about $8K worth of IAR tools (compiler + Visual State.)  When I need to make a change to that product, I fire up the tools, make my revisions, test them, and ship them.The other was developed with a popular free assembler.  I&#39;ve read the code, and I think I understand it.  That being said, I won&#39;t touch that code with a ten foot pole &#8211; it works and the risk of introducing a bug it too high.  This is one of the motivations for development of the former product.       My anecdote is probably more a testament to the power of statecharting tools than it is about the rest of the toolchain.  Nevertheless, when the right tools are used, the tools are well worth it.  (Nigel is as well.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2010/02/is-gcc-a-good-compiler/comment-page-1/#comment-394</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Wed, 03 Feb 2010 12:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2010/02/02/is-gcc-a-good-compiler/#comment-394</guid>
		<description>Ouch - and I thought it was only my wife that considered me cheap! I certainly know of consultants that support their own tool chains - and even make a virtue of it. Indeed Bill Gatliff for example has a consulting business largely based on promoting the use of open sourced tools. I&#039;d be interested to know if the &#039;Expensive&#039; consultants you are referring to bill their clients for the time they spend supporting their own development tool chains.</description>
		<content:encoded><![CDATA[<p>Ouch &#8211; and I thought it was only my wife that considered me cheap! I certainly know of consultants that support their own tool chains &#8211; and even make a virtue of it. Indeed Bill Gatliff for example has a consulting business largely based on promoting the use of open sourced tools. I&#39;d be interested to know if the &#39;Expensive&#39; consultants you are referring to bill their clients for the time they spend supporting their own development tool chains.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
