Alignment Assumptions - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

Caveats
The compiler might conclude that the value of
assignment to
lvalues.
int
It might then use this conclusion to rewrite the above code as follows:
This is fine as long as
does something like:
before it executes the second fragment, the wrong value would get stored
in
.
*ps

Alignment Assumptions

The compiler sometimes uses pointer type information when deciding
whether or not memory references are properly aligned for some
optimizations.
Thus, the compiler assumes that all pointer expressions are aligned as their
pointed-to types would indicate. For example,
as an assertion that the low 3 bits of
The compiler also infers more stringent alignment for individual variables
than would be indicated by their types alone, since it assumes that the
allocation is aligned according to the compiler's rules.
So, if your program defines global variables in assembly code that are
referenced by C routines, or if it has its own memory manager (e.g.,
malloc
or unaligned references may result.
, because double objects cannot legally be referenced by
*pi
register double t = *pr;
*pq = t;
*pi = *pj;
*ps = t;
really doesn't overlap
*pi
double d;
pi = (int *) &d;
pr = &d;
), the allocations must be aligned according to the compiler's rules
is unaffected by the
*pr
, but if your program
*pr
((double *) e)
are
.
e
0
12
is treated
12-3

Advertisement

Table of Contents
loading

Table of Contents