Aliasing (computing)

In computing, aliasing describes a situation in which a data location in memory can be accessed through different symbolic names in the program.

As an effect of this assignment to *y, the value of x would be changed as well, so propagating the information that x is 5 to the statements following *y = 10 would be potentially wrong (if *y is indeed an alias of x).

If the compiler decides that x is not aliased by *y, then code that uses or changes the value of x can be moved before the assignment *y = 10, if this would improve scheduling or enable more loop optimizations to be carried out.

To enable such optimizations in a predictable manner, the ISO standard for the C programming language (including its newer C99 edition, see section 6.5, paragraph 7) specifies that it is illegal (with some exceptions) to access the same memory location using pointers of different types.

[3] In such cases, when compiled with gcc, the option -fno-strict-aliasing is invoked to prevent unwanted optimizations that could yield unexpected code.

Address bits (named A2 through A0) are decoded to select unique memory locations as follows, in standard binary counter fashion: In the table above, each of the 8 unique combinations of address bits selects a different memory location.

However, if one address bit (say A2) were to be shorted to ground, the table would be modified as follows: In this case, with A2 always being zero, the first four memory locations are duplicated and appear again as the second four.