Grant Edwards wrote:
Sorry if I sounded a bit shrill, but you're suggesting a
compiler which refuses to compile 100% legal standard ANSI C
source code. I just don't see how that's a real option.
That's more like it!
Sorry, Steve Underwood, but Grant's right. That's not to belittle the
efforts of you and Dmitry over the years getting all this stuff working,
it's a great toolset. It just gets bugs sometimes.
I've been a compiler maintainer (on a home-grown Tiny-C about 20 years
ago). I know what it's like. No-one congratulates you for the great code
the compiler generates 99.9% of the time, they just winge about the 0.1%
stuff!
But as I said, Grant's right. The compiler *must* generate runnable code
(if it is to generate anything). It doesn't have to be *good* code, but
it must run.
Normally, the compiler should avoid alignment issues by padding structs
and things so that they can't get misaligned, but if the user uses
#pragmas or other constructs to force unaligned data then probably the
best thing is to generate whatever crap code that it needs(*), and
generate a warning that the alignment problem is causing a problem.
That would sort it for everyone, surely?
Steve.
(*) In the illustrated case (earlier) that would seem to be two mov.b
instructions to shift a single 16-bit misaligned quantity.