Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

Compiler Command-Line Driver
2012-2013 Microchip Technology Inc. DS50002071C-page 97
-fstrict-aliasing Allows the compiler to assume the strictest aliasing rules applica-
ble to the language being compiled. For C, this
activates optimizations based on the type of expressions. In par-
ticular, an object of one type is assumed never to reside at the
same address as an object of a different type, unless the types
are almost the same. For example, an unsigned int can alias
an int, but not a void* or a double. A character type may alias
any other type.
Pay special attention to code like this:
union a_union {
int i;
double d;
};
int f() {
union a_union t;
t.d = 3.0;
return t.i;
}
The practice of reading from a different union member than the
one most recently written to (called type-punning) is common.
Even with -fstrict-aliasing, type-punning is allowed, pro-
vided the memory is accessed through the union type. So, the
code above will work as expected. However, this code might not:
int f() {
a_union t;
int* ip;
t.d = 3.0;
ip = &t.i;
return *ip;
}
-fthread-jumps Perform optimizations where a check is made to see if a jump
branches to a location where another comparison subsumed by
the first is found. If so, the first branch is redirected to either the
destination of the second branch or a point immediately following
it, depending on whether the condition is known to be true or
false.
-funroll-loops Perform the optimization of loop unrolling. This is only done for
loops whose number of iterations can be determined at compile
time or run time. -funroll-loops implies both -fst-
rength-reduce and -frerun-cse-after-loop.
-funroll-all-loops Perform the optimization of loop unrolling. This is done for all
loops and usually makes programs run more slowly.
-funroll-all-loops implies -fstrength-reduce, as well
as -frerun-cse-after-loop.
TABLE 5-12: SPECIFIC OPTIMIZATION OPTIONS (CONTINUED)
Option Definition

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh