In an attempt to not hijack the thread I'm changing the subject line.  Do you 
have some significant differences in your compile or link parms between COBOL 4 
and COBOL 5?  What would be accounting for the rather significant load module 
size growth between 4 and 5?

Rex

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Greg Shirey
Sent: Thursday, October 02, 2014 1:45 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Enterprise COBOL v5.1 Implemented?

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:IBM-MAIN@LISTSERV.UA.EDU] 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN

The information contained in this message is confidential, protected from 
disclosure and may be legally privileged.  If the reader of this message is not 
the intended recipient or an employee or agent responsible for delivering this 
message to the intended recipient, you are hereby notified that any disclosure, 
distribution, copying, or any action taken or action omitted in reliance on it, 
is strictly prohibited and may be unlawful.  If you have received this 
communication in error, please notify us immediately by replying to this 
message and destroy the material in its entirety, whether in electronic or hard 
copy format.  Thank you.


----------------------------------------------------------------------
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