Phil said:
Did you for one minute think that I would expect a normal compiler
to be any different in this regard? If so, why? Care to point out
a few lines of mine, or even a few words, where I mention any
differences between a normal compiler and a cross compiler?
The underlined phase above, "Or think of a cross compiler" implies that
it is a special attribute of a cross compiler as opposed to any other
type of compiler. That was not from you, but your response was in reply
to my saying that a cross-compiler can do it when a "normal" compiler
can. I made the natural (to me) assumption that you were disagreeing
with that since it was the point under discussion.
How can an cross compiler either set or know in advance something
which might be configured when the microcode is uploaded to the
processor at boot time?
All of the cross compilers I've used came with startup code which set
the processor in to a known state. If the rounding mode is completely
out of the control of the implementation then FLT_ROUND should yield -1
to indicate the rounding mode is indeterminable and in that state it
does not (as far as I can tell) need to use a consistent rounding mode.
I like the way you've combined compiling and linking. You've
not done much programming in the real world, have you?
I've done over 20 years of it, some for embedded systems, some for
desktops, some for servers. Since some compilers do "whole program
optimisation" they are doing some of what would often be considered part
of the compilation phase (the optimisation) after doing some of what
would normally be considered the linking phase, so yes I did mention
both phases because the distinction is not always as clear cut as one
might expect and such implementations would (in my opinion) find it
easiest to do what I suggested above.
I think you'll find that was my point.
If your point is that for any compiler there are situations when this
optimisation cannot be done your are probably correct.
My point is that there is no difference between a cross compiler and any
other compiler in this respect, and there are situations where it can be
done.
A sufficiently hamstrung implementation could justifiably
have such restrictions, yes.
No need for the implementation to be hamstrung, just to make use of the
pragmas specified in C99 and put the processor in to a defined mode
during startup. That isn't a hamstrung implementation.
However, in most circumstances I'd
consider that to be a poor QoI. Offering the user the ability to
make or not make those assumptions, however, is good QoI.
Which is exactly what the standard pramas I mentioned above are for. It
is up to the implementation what the default state is, so if the user
cares they should specify what they want. No need for compiler options,
just the use of facilities defined by the standard. I'm undecided as to
which the better default would be.