At least gcc can, since it can read the source from standard input. You can also use Unix here string bash construction:
gcc -xc - << "int main() { exit(0); }"
or here is the construction of the sh file:
gcc -xc - <<MARK int main() { exit(0); } MARK
---- EDIT ----
You can also imagine, using cryptography to encode your source, untwist content on the fly and enter the result on gcc standard input, something like:
uncipher myfile.protected | gcc -xc -
source share