Tested with 8.00 RC6 and 7.00 (refresh).
With any of the optimization options, bad code is generated.
With optimization on, gcd returns 0. With optimization off it returns 1, which is the correct result.
int gcd(int a, int b)
{
if(b) return gcd(b,a%b);
else return a;
}
int main(void)
{
return gcd(1,1);
}