This is actually why GCC has (or at least did at one point) an extra clause to the GPL to specifically allow its output to be used in non-GPL programs. Because the compiler output necessarily has to copy some bits from the compiler, it was the FSF's belief that programs compiled with it would become derived works and hence be forced to use the GPL. They didn't want that, so they added the extra clause.
You may think that's a strange interpretation, but before GCC many compilers took that exact same stance. You bought the compiler and you did not have a license to distribute the resultant binary. You had to pay an extra fee for the right to distribute your own compiled code. That pretty much stopped when Borland released a compiler with a mostly sane license. You can imagine why, though, that Cygnus made so much money doing contract work for GCC in the embedded space -- every other compiler required royalties for everything you shipped!