<p>The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are however <em>very</em> scared of c-compiler bugs (for a good reason historically), and wonder if anyone has insight to which version we should upgrade to.</p>

<p>Are people using 4.3.2 for large code-bases and feel that it works fine?</p>

[{'answer_id': 32475, 'author': 'Bernard', 'author_id': 61, 'author_profile': 'https://Stackoverflow.com/users/61', 'pm_score': 1, 'selected': False, 'text': "<p>I don't have a specific version for you, but why not have a 4.X <em>and</em> 3.4.6 installed? Then you could try and keep the code compiling on both versions, and if you run across a show-stopping bug in 4, you have an exit policy.</p>\n"}, {'answer_id': 32506, 'author': 'KannoN', 'author_id': 2897, 'author_profile': 'https://Stackoverflow.com/users/2897', 'pm_score': 0, 'selected': False, 'text': '<p>If you are interested in OpenMP then you will need to move to gcc 4.2 or greater.  We are using 4.2.2 on a code base of around 5M lines and are not having any problems with it.</p>\n'}, {'answer_id': 33297, 'author': 'dmo', 'author_id': 1807, 'author_profile': 'https://Stackoverflow.com/users/1807', 'pm_score': 2, 'selected': False, 'text': '<p>When I migrated a project from GCC 3 to GCC 4 I ran several tests to ensure that behavior was the same before and after.  Can you just run a run a set of (hopefully automated) tests to confirm the correct behavior?  After all, you want the "correct" behavior, not necessarily the GCC 3 behavior.</p>\n'}, {'answer_id': 37293, 'author': 'nimish', 'author_id': 3926, 'author_profile': 'https://Stackoverflow.com/users/3926', 'pm_score': 3, 'selected': True, 'text': '<p>The best quality control for gcc is the linux kernel. GCC is the compiler of choice for basically all major open source C/C++ programs. A released GCC, especially one like 4.3.X, which is in major linux distros, should be pretty good.</p>\n\n<p>GCC 4.3 also has better support for optimizations on newer cpus.</p>\n'}, {'answer_id': 122630, 'author': 'Branan', 'author_id': 13894, 'author_profile': 'https://Stackoverflow.com/users/13894', 'pm_score': 0, 'selected': False, 'text': "<p>I can't say anything about 4.3.2, but my laptop is a Gentoo Linux system built with GCC 4.3.{0,1} (depending on when each package was built), and I haven't seen any problems. This is mostly just standard desktop use, though. If you have any weird code, your mileage may vary.</p>\n"}, {'answer_id': 14654717, 'author': 'vonbrand', 'author_id': 1839777, 'author_profile': 'https://Stackoverflow.com/users/1839777', 'pm_score': 1, 'selected': False, 'text': '<p>Use the latest one, but <em>hunt down and understand</em> each and every warning <code>-Wall</code> gives. For extra fun, there are more warning flags to frob. You <em>do</em> have an extensive suite of regression (and other) tests, run them all and check them.</p>\n\n<p>GCC (particularly C++, but also C) has changed quite a bit. It does much better code analysis and optimization, and does handle code that turns out to invoke undefined bahaviiour differently. So code that "worked fine" but really did rely on some particular interpretation of invalid constructions will probably break. Hopefully making the compiler emit a warning or error, but no guarantee of such luck.</p>\n'}]
['https://Stackoverflow.com/questions/32448', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1524/']