Question about GCC 5.2.0 and expression reordering
Andrew Haley
aph@redhat.com
Wed Jun 14 16:56:00 GMT 2017
On 14/06/17 17:40, David Barto wrote:
> Thanks for that. Can you point to the relevant portion of the standard that
> I can then quote back to my Boss who is quite concerned about this?
1.9 Program execution [intro.execution]
The semantic descriptions in this International Standard define a
parameterized nondeterministic abstract machine. This International
Standard places no requirement on the structure of conforming
implementations. In particular, they need not copy or emulate the
structure of the abstract machine. Rather, conforming implementations
are required to emulate (only) the observable behavior of the abstract
machine as explained below.5
5) This provision is sometimes called the âas-ifâ rule, because an
implementation is free to disregard any requirement of this
International Standard as long as the result is as if the requirement
had been obeyed, as far as can be determined from the observable
behavior of the program. For instance, an actual implementation need
not evaluate part of an expression if it can deduce that its value is
not used and that no side effects affecting the observable behavior of
the program are produced.
> And if there is such a flag to disable the âOptimizationâ performed here
> what would I enable?
I have no idea.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the Gcc-help
mailing list