Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the GCC function suffix .constprop mean?

Looking at the disassembly of a C++ program, I see functions like _Z41__static_initialization_and_destruction_0ii.constprop.221. What does the constprop mean in this case? It appears to be similar in appearance to the isra suffix (and is sometimes combined, e.g. .isra.124.constprop.226), but it means something else.

like image 917
nneonneo Avatar asked Feb 10 '13 10:02

nneonneo


1 Answers

From source code comments I've read - they indicate functions which have been cloned during optimization.

EDIT: This may be the answer, maybe not.

Simple constant propagation

This file implements constant propagation and merging. It looks for instructions involving only constant operands and replaces them with a constant value instead of an instruction. For example:

add i32 1, 2

becomes

i32 3

NOTE: this pass has a habit of making definitions be dead. It is a good idea to to run a DIE (Dead Instruction Elimination) pass sometime after running this pass.

SOURCE

like image 198
zaf Avatar answered Oct 14 '22 01:10

zaf