Greicy.Costa-Marques@xxxxxxx writes: >> One important question >> is going to be how you know which variable you want to duplicate. > > yes, i know which variables i want to duplicate. > >> Presumably you don't want to duplicate all variables. > > no, i want to duplicate all variables in my code. > >> Another important question is what you want to do with the >> duplicated variable. > > Because I want to harden my code. I'm working with fault injection > by software and I want to harden my code, and a way of hardening is > the duplication of variables. And as I still do not know how, I chose > to start trying for a single variable and after to use the same path > for all variables in my code. It's a lot easier to duplicate all variables than it is to duplicate a single variable. I do not know what duplicating variables has to do with hardening code. >> If you duplicate the variable in a straightforward way, the duplicate will >> simply be removed by the optimization passes. > > I want the duplication remains after optimization. How do you propose to make that happen? How will the program use the duplicated variable? > In my work I have to do that with gcc (in another words i have to > modify the compiler so it makes it) > > you said is necessary to have to learn a fair amount of gcc > infrastructure in order to do it. Like what? That question is too general for me to answer. I recommend that you read the gcc internals manual and look at the gcc source code and try to ask more specific questions. Ian