I have worked in automotive for close to a couple decades and it is the type
of thing that this industry would not do for a couple reasons.
First there is very few things that can be done in asm that cannot be done in C.
However, those things are of high importance. Just maybe not to some C
programmers.
Assembly gives you the access to the machine at a level that allows you to
implement things like accurate stack unwinding, exception handling and
completely precise garbage collection.
Not all of these can be done by merely calling assembly routines or inline
code from C, because they depend coding conventions, and so control over the
compiler is necessary).
If your view of computing embraces such capabilities, then you will find
assembly language to be more capable than C.
For instance, take garbage collection. Suppose that in some function there is
a statement "x = NULL", where x is local and there are no more uses of x in the
remaining block. An optimizing C compiler could simply not bother with this
assignment since x has no next use. But what if there is garbage collection?
The variable x could be the last reference to a large amount of memory, whose
reclamation will be prevented if the assignment is optimized away.
The C compiler does not know that x has a kind of next use: it can be visited
"behind the scenes" by the garbage collector! C compilers are GC-unfriendly in
numerous ways, one of which is this generation of semantic garbage: keeping
values in memory or registers beyond the point at which they have become
garbage in the source semantics. In assembly we don't have this problem;
since we know what we put into every memory location and register.
We would like to be able to extend the C compiler with new rules such as
"whenever a pointer variable has no next use, generate code to overwrite it
with null", but the language doesn't give us a way to direct the translation in
such ways.
Very few as in some C compilers actually check that everything that can be
done in asm can be done in C.
Really? An example or two would go a long way here.