Disclaimer: I am not a lawyer; if you are concerned about these issues you should consult a licensed practitioner.
GCC and its runtime libraries specifically come with a "Runtime Exception" clause in their licenses, which you can find here: http://www.gnu.org/licenses/gcc-exception-3.1.html
The exception essentially does the following:
When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception.
Therefore, compilation against GCC header and library files with non-GPL code does not itself violate the GPL.