Caveats
12-1
12
This chapter provides useful programming tips on:
• Aliasing assumptions
• Alignment assumptions
• Volatile object
• Known problems
• C version incompatibilities
• Troubleshooting
Aliasing Assumptions
Some compiler optimizations (for example, fshadow-mem) use type
information as the basis for several assumptions. These assumptions
exclude some pairs of memory references as possible alias candidates.
If your program violates these assumptions, the compiler may generate
code that does not function as you intended.
Here are the rules the compiler uses:
character (i.e.,
char, unsigned char, signed char)
lvalues can access all objects, regardless of type.
ordinal (e.g.,
int, short, long, enum) lvalues can
access only ordinal objects of the same size
(regardless of sign) or character objects.
real (e.g.,
float, double, long double) lvalues can
access only real objects of the same size, or
character objects.