Pragma Pure - Intel i960 User Manual

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

Advertisement

Language Implementation

#pragma pure

Specifies that a function has no effects other than returning a computed
value and that it does so based solely on its input parameters.
#pragma [no]pure [ ( function [,... ] ) ]
function
Default
The compiler assumes functions are not pure and does not perform
optimizations possible with pure functions.
Discussion
informs the compiler that a named function has no effects
pragma pure
other than returning a computed value and that it does so based solely on
its input parameters. Specifically, the compiler assumes the following
about the function:
No I/O is performed.
No global variables or memory locations are read or modified.
No modifications of registers occur, except those explicitly defined by
the calling sequence.
This knowledge enables the compiler to perform optimizations around
function calls, optimizations it could not perform without this knowledge.
If a function is "pure", then the compiler can perform (around that
function call) constant propagation, common subexpression elimination,
global-variable migration, and dead-code elimination.
identifies the specific function to which the
pragma applies. If
function
effect of the pragma is applied to all functions
called in the compilation module following the
pragma. If a function name is specified, the
pragma must be placed before the function
definition.
7
is missing, the
7-37

Advertisement

Table of Contents
loading

Table of Contents