Repro file:
#include <bits/stdc++.h>
using namespace std;
int main()
{
#ifdef HELLO
cout << "Hello World" << endl;
#else
cout << "Hi World" << endl;
#endif
}
Run sccache gcc -c main.cpp -DHELLO. Then run sccache gcc -c main.cpp. You will see that the second command registers a cache hit when it clearly shouldn't.
This happens because as shown here, preprocessor_and_arch_args doesn't take common_args into account, and since -DHELLO belongs to common_args, removing it doesn't affect the hash of preprocessor_and_arch_args, hence registering a cache hit.