Let me put it this way...
Error messages are the user interface of a compiler
Except for language extensions, the language that a typical compiler accepts is more or less independent of the compiler. Programmers rarely modify command-line options once they are set. Almost none of a compiler's users will spend time inspecting the generated code.
So the main "user interface" of a compiler is its errors and warnings.
I once used a compiler (not naming any names) which would occasionally produce this output:
Your program contains one or more syntax errors. And that's it. Obviously this is an extreme example, but it goes to show that a bad error message is useless.
High quality error diagnostics can save a programmer hours. The programmer can check the intent behind a piece of code, without worrying about syntax or type correctness, and the compiler can do the work that it's relatively easy for a compiler to do.