On 22 June 2016 at 19:05, Andrew Pinski <pins...@gmail.com> wrote:
> On Wed, Jun 22, 2016 at 10:59 AM, Manuel López-Ibáñez
> <lopeziba...@gmail.com> wrote:
>> On 22/06/16 10:02, Florian Weimer wrote:
>>> GCC could parse the assembly instructions and figure out the clobbers.
>>
>>
>> Which is also needed for various things, such as providing better
>> diagnostics:
>>
>> http://permalink.gmane.org/gmane.comp.compilers.llvm.cvs/70335
>
> Actually GCC outputs markers that modern gas understands and you get
> much better diagnostic already compared to what was reported above.

We get better diagnostics than in the past, but not as good as
Clang's. And there are many limitations of the "markers" approach: Not
only there is no column info, line info is often wrong:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57950

And there remains a lot of work to get GAS to output diagnostics like
GCC does nowadays (colors, caret, fix-it hints, etc.). And additional
work to make GAS obey GCC settings (if GCC disables colors, then GAS
should not output colors). Most of that work will be duplication of
what GCC already does.

Besides diagnostics, the integrated assembler is faster (as proven by
David Malcom's experiments) and it provides additional info to GCC
(the point raised by Florian).

> Note each target in gas has its own way of parsing assembly code which
> is one of the reason why it is so hard todo the above and also each
> target has its own wording which can confuse people.  I think if you

I didn't say it was easy. Yet, Clang/LLVM did it.

> want better diagnostic from assembly code, then working on binutils to
> unify things including error messages (and subtarget support) would be
> a much better use of time than integrating binutils into gcc.

Unifying error messages does not seem to be a feature used to
advertise Clang as a replacement for GCC. It doesn't seem to be what
users discuss in various forums (including the reddit thread I quoted
above). It won't help with the issues discussed in this thread.

Cheers,

Manuel.

Reply via email to