This happens e.g. with sys-libs/llvm-libunwind's test suite. With ccache-4.5.1, it works just fine. With 4.6-r1, it fails with confusing errors. After digging, it turns out that internal (silent) checks for compiler flags fail with errors like:
ccache: error: Failed to create directory /var/lib/portage/home/.cache/ccache/tmp: Permission denied
Also happens with 4.6.1.
Please report the issue upstream.
Upstream? Feel free to convince them that this is their fault, not ours.