I've been trying to compile one of my projects with gcc 4.9.1 in Arch, every time it produced wrong assembly which lead to the program crashing. Switched to clang, now everything works fine.
Announcement
Collapse
No announcement yet.
GCC 5.0 Doesn't Show Much Difference Yet For AMD's Steamroller
Collapse
X
-
Originally posted by AnAkIn View PostI've been trying to compile one of my projects with gcc 4.9.1 in Arch, every time it produced wrong assembly which lead to the program crashing. Switched to clang, now everything works fine.
Rule of thumb: If you think you have spotted a compiler error. You should consider youself wrong and fix your code instead (With more than 10 years of experience with C++ I have found one compiler error in GCC, but suspected errors more than 10 times and been wrong in every case but once).
Comment
-
Originally posted by AnAkIn View PostI've been trying to compile one of my projects with gcc 4.9.1 in Arch, every time it produced wrong assembly which lead to the program crashing. Switched to clang, now everything works fine.
Comment
-
Originally posted by carewolf View PostIf you program contains invalid code that can cause GCC to miscompile it is only a matter of time before issues will crop up with any compiler. Better fix your code than complain about compilers.
Rule of thumb: If you think you have spotted a compiler error. You should consider youself wrong and fix your code instead (With more than 10 years of experience with C++ I have found one compiler error in GCC, but suspected errors more than 10 times and been wrong in every case but once).
Comment
-
Originally posted by AnAkIn View PostThe code is in Valve's Source SDK, which I need for my project, and there's nothing wrong with it, it's a pretty simple code. MSVC and Clang compiles it correctly. GCC used to compiles it correctly as well, just not the latest versions.
Things like that are why I always run my test sets against both the debug code with asserts and also the O3 profile optimized version.
To sum up: Just because some code has been used for a long time, and other compilers compile it correctly, does NOT mean that the code is correct.
Comment
Comment