Forgot your password?
typodupeerror
Software

+ - How to make C/C++ compilers generate terrible code-> 1

Submitted by Anonymous Coward
An anonymous reader writes "Compilers are designed to make pessimistic assumptions about the code if the code is ambiguous. These pessimistic assumptions significantly limit the compilers' optimizations. Programmers can help compilers by avoiding code patterns that are known to confuse them. This article presents three examples of compiler-unfriendly code and explains them in great depth. I found this post enlightening and novel since I haven't seen a post on this topic. Its a good read if you want to understand what a compiler does to your code."
Link to Original Source
This discussion was created for logged-in users only, but now has been archived. No new comments can be posted.

How to make C/C++ compilers generate terrible code

Comments Filter:
  • Nice article. I knew some of it already but had not thought of the function calls across multiple files. My problem is however is that why people use C/C++ at all. I understand that C/C++ programmers need to jump through a lot of hoops to get the compiler to understand the big picture. This is why I prefer JAVA because their is no ambiguous code. The compiler knows everything and every dependency.

Some people have a great ambition: to build something that will last, at least until they've finished building it.

Working...