Given the following function:
void rec_func(int a, int b, const int c) {
/*
flow control and stuff here
*/
rec_func(a - 1, b, c);
}
Will gcc understand that c is the same constant value for all the recursive calls and then will use the same variable for all the calls, or it will copy the value of c to a new c variable each call?
The same question for b, even if not marked with const, will gcc understand that is implicitly const?
Edit1:
The question is made from an optimization perspective
Edit2:
By "implicitly const" I do not mean some keyword. I mean, a variable not tagged with the const modifier whose value will never change once initialized.