C (gcc), 45 bytes
f(x,y)int*y;{*y=x*~x?x&1|2*f(x>>1,&x):x;x=x;}
Odd bits are returned directly, while even bits are returned through the pointer in the second argument.
Explanation
f(x, // recrusive method with integer parameter x y)int*y;{ // odd bits are returned; even bits are returned through y *y = x * ~x // if x * (x - 1) is non zero (i.e. x is not 0 or -1) ? x&1 | 2*f(x>>1 // then y = x&1 | 2*odd_bits(x>>1) ,&x) // x = even_bits(x>>1) : x; // else y = x x = x;} // return x