Intel i960 User Manual page 317

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

Advertisement

Caveats
Volatile objects are also presumed to have been changed in unknowable
ways between such points.
Here is an example of a program that fails because of a memory reference
that needs to be made volatile:
fiddle.c:
#define MY_PORT *((int *) 0x10000)
...
int read_my_port ()
{ return MY_PORT;
}
faddle.c:
...
while (read_my_port() == 0)
/* do nothing */;
ok_go_do_something ();
This program is incorrect, but it functions as intended when compiled with
compilers that do not attempt inlining across
When these two files are compiled with global inlining, the compiler
translates the program to:
(1)
while (MY_PORT == 0)
/* do nothing */;
ok_go_do_something ();
And, since
appears to be loop invariant (because it isn't volatile),
MY_PORT
we then get:
(2)
t = MY_PORT;
while (t == 0)
;
which loops forever if the first value read from
files.
.c
is
.
*0x1000
0
12
12-5

Advertisement

Table of Contents
loading

Table of Contents