For Partial Evaluation, you must generate a "residual" version of the original program by specialization where all static data is already bound and evaluated.
Simplest example would be compiling in configuration parameters, so a specific code-path is preselected before runtime. Another classic example would be C++ template meta-programming where that part of the program is not evaluated at runtime.
I first came to know of these techniques from the classic Generative Programming: Methods, Tools, and Applications by Krzysztof Czarnecki and Ulrich W. Eisenecker which is still relevant today.
Checking with Google, it seems GCC does not have a separate partial evaluator but one can use coding techniques+aggressive optimization switches to approximate it. For separate "Futamura Projection" like partial evaluators there seem to be C-Mix/LLPE etc.