On Thu, 25 Oct 2018 17:16:49 -0400, Tony Harminc  wrote:
>
>> (In debug mode, the compiler generated STH; LH of a halfword variable not
>> otherwise referenced, truncating an invalid halfword value.  Even before 
>> that,
>> I had felt that by design STH should program check on such a condition.)
>
>What halfword value is invalid? Surely by definition...
>
>Oh - you mean silent truncation of a larger value into a halfword?
>What does the language (what language?) definition say about this?
>And what did the optimized code do that failed?
> 
Mainsail, one of my most enjoyable programming experiences:
    https://en.wikipedia.org/wiki/SAIL_(programming_language)

An embryonic attempt at O-O.  Alas, several years ago the vendor's web
site was for sale.

"Machine independent".  The data type was not "halfword", but "int", defined
as [-32768,32767] and stated that the effect of assigning a larger value was
undefined.  Debugger should have enforced.

The optimized code simply omitted the STH which debugger used only to
examine a value at breakpoint and the LH which allowed debugging to
modify that value.  Optimized code kept the value in a GR.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to