gcc -print-prog-name=cc1 prints the path to the installation of cc1. for prog in cc1 cc1plus collect2 f771 jc1 jvgenmain; do
printf "%-10s : %s\n" $prog $(gcc -print-prog-name=$prog)
done
gcc -print-prog-name=cpp not find the path of cpp. gcc -print-file-name=cpp does find it.