Hello, if there is code like
if (condition) bla = blub;
than the timming can be different if condition is true or false.
How to make timing equal on both path?
Is
else dummy = blub;
a good idea?
Are there other ways?
As already noted, you can't just add an else statement.
Even if you do add an else statement and balance the two paths with zero or more nop statements, an update of the compiler or change of optimization level can completely change the timing.
Note also that C compilers seldom implement their tests and jumps in the way the C code suggests. As the complexity of the processors increases, the compilers will spend more and more time to reorder instructions to balance memory requests, register usage, locality-of-reference etc.
"an update of the compiler or change of optimization level can completely change the timing."
It could change even without updating the compiler or adjusting the optimisation.
eg, just by adding apparently unrelated code, the compiler might change its choice of which variables to optimise into registers...
So, one more time:
if this is really important to you, then you must do it in assembler. Period.