Page "Compiler optimization" Paragraph 10
from
Wikipedia
; Programming language – independent vs language-dependent: Most high-level languages share common programming constructs and abstractions: decision ( if, switch, case ), looping ( for, while, repeat .. until, do .. while ), and encapsulation ( structures, objects ).
For instance, the existence of pointers in C and C ++ makes it difficult to optimize array accesses ( see alias analysis ).
However, languages such as PL / 1 ( that also supports pointers ) nevertheless have available sophisticated optimizing compilers to achieve better performance in various other ways.
Therefore, if a program makes several calls to the same function with the same arguments, the compiler can immediately infer that the function's result need be computed only once.
The optimizer can determine which function has no side effects, and restrict such optimizations to side effect free functions.
Page 1 of 1.
2.177 seconds.