On Wed, 3 Apr 2013 17:28:38 -0700 (PDT), Rick Smith <[email protected]> wrote:
I am cross-posting exchange to the listserv ibm-main for further comment. ibm-main is mirrored to bit.listserv.ibm-main. People who read the listserv don't see posting directly to bit.listserv.ibm-main. >On Wednesday, April 3, 2013 7:56:42 PM UTC-4, Clark F Morris wrote: >> On Wed, 3 Apr 2013 15:39:20 -0700 (PDT), Rick Smith >> <[email protected]> wrote: >> >> >Apparently, the same is true of IBM COBOL, though not for their >> >C/C++ and PL/1 compilers. >> >> Are you sure about Enterprise COBOL? I am fairly certain that Tom >> Ross of IBM COBOL development listed loop unrolling as one of the >> improvements in VS COBOL II version 1.4 or COBOL for MVS and VM, >> predecessors of Enterprise COBOL. I know it does code movement and >> detects when a field with a value clause is unchanged so that >> subscripts can be recalculated and certain other optimizations can >> happen. I found this out when testing certain things and finding no >> code generated for certain calculations or just a move. There would >> be no special option other than specification of OPTIMIZE (or weren't >> because now there are variants of OPTIMIZE). > >Using the Google search: site:ibm.com cobol loop unroll >did not provide any references to COBOL loop unrolling, >though it did provide references to the other languages. I searched for IBM Enterprise COBOL code movement and found nothing but I know that it is done from having looked at the procedure division maps. I can code a field as CONSTANT-ONE PIC 9 DISPLAY VALUE 1. and if the field is never modified the compiler will substitute a packed constant of 1 if the field is used arithmetically with packed fields or calculate the subscript value at compile time if CONSTANT-ONE is used as a subscript. This latter trait caught me by surprise when I wrote a small program to test code generation. > >Am I sure? No, but if it is available, IBM isn't noting >it on the web sites or in the COBOL manuals I searched. I suspect the Tom Ross presentation to SHARE on the optimizations done is long enough ago that it wouldn't be online (at least 10 years ago and I could believe 15 or more). Clark Morris ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
