Nullstone Logo

COMPANY
Home
Contacts
Customers
Testimonials

PRODUCTS
Overview
NULLSTONE for C
NULLSTONE for Java
Technical Overview

SUPPORT
Release Notes
Download
PGP Information
Service Report
Write Us

INFORMATION
Performance Results
Glossary of Terms

RELATED LINKS
Compiler Connection
Compiler Jobs

Previous Up Next
Constant Propagation

Constants assigned to a variable can be propagated through the flow graph and substituted at the use of the variable.

Example:

In the code fragment below, the value of x can be propagated to the use of x.

    x = 3;
    y = x + 4;
    

Below is the code fragment after constant propagation and constant folding.

    x = 3;
    y = 7;
    

Notes:

Some compilers perform constant propagation within basic blocks; some compilers perform constant propagation in more complex control flow.

Some compilers perform constant propagation for integer constants, but not floating-point constants.

Few compilers perform constant propagation through bitfield assignments.

Few compilers perform constant propagation for address constants through pointer assignments.

© 1990-2012 Nullstone Corporation. All Rights Reserved.