Okay, I had been working with a small program with a couple of lines of removed code. So, I took a program where the PROCEDURE DIVISION had some 3900 lines of code, and was basically coded like this: Open File 1 Open File 2 Move some values around SORT with INPUT PROCEDURE and OUTPUT PROCEDURE Close Files GOBACK.
I commented out the SORT statements and compiled COBOL 4.2 with full optimization and got this message: 7996 IGYOP3091-W Code from "procedure name 2000-READ-VENDOR" to "GO (line 13628.01)" can never be executed and was therefore discarded. So, some large number of lines of code (from line 7996 to line 13628) was discarded. Compiled source code COBOL 4.2 with OPT(FULL): MODULE SIZE: 0000D0A8 Compiled source code COBOL 4.2 with NOOPT: MODULE SIZE: 0001EC18 Compiled source code COBOL 5.1 with OPT(0): MODULE SIZE: 0003D72C Compiled source code COBOL 5.1 with OPT(2): MODULE SIZE: 0002CB3C So, it does appear that there is some optimizing of the code happening with COBOL 5.1, but if lines are being discarded, the compiler is not reporting on it. Thanks for the feedback, Greg -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Elardus Engelbrecht Sent: Thursday, October 02, 2014 10:53 AM Greg Shirey wrote: >Inside the paragraph that never gets executed, I added the following >statement: >MOVE "BUBBA" to WS-DESC. What are the conditions you set that the part will never be executed? In a part of boolean statement which are always FALSE or is that a part of a routine/function which are never called at all? >After recompiling with OPT(2), I browsed the program object and was >able to find "BUBBA" which leads me to believe that the optimizer is no >longer removing code that cannot be executed. (At least in this case.) Weird. Are the module size the same with all these OPT values? It should be different. >Is that a bug? I'll ask IBM and report back. Perhaps, but exclude any debugging compile/linkedit options and search again for 'JABBA', oops, 'BUBBA'. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
