On Sun, 21 Jul 2013 17:03:55 -0400, John Gilmore wrote:
>
><begin extract>
>It is at the compiler's and optimizer's discretion to decide the order
>of execution for code that the C++ standard does not specifically
>define. This includes overlapping execution.
></end extract>
>
>and this may be conceded.  What is not "in the compiler's and
>optimizer's discretion" is to produce different final numerical or
>string results for different levels of optimization.
>
Agreed, with an exception.

Long ago, with a different language from a different vendor
my program program checked when optimized.  In debug
mode it ran successfully and produced the result I intended.

Reported to vendor who replied (correctly) that I had relied
(inadvertently) on a construct described the reference as
undefined, allowing the behavior to differ between different
levels of optimization.  I went away unsatisfied.

The only permissible exception is that an error should be
reported in debugging mode when the result is undefined
and no error is reported in optimized mode.

( the problem occurred because in debugging mode the
compiler generated the sequence:

    STH    (truncating the value)
    LH       (lest a breakpoint be set here)
    SLA

In optimized mode, only the:

    SLA    (with fixed-point overflow detected,)

I consider it a shortcoming of aboriginal S/360 design that
neither MH nor STH generates a fixed-point overflow error
when appropriate.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to