On 11/02/2023 7:42 am, Farley, Peter wrote:
I'd consider this to be a bug in the compiler. The listing pmap should show all 
source statements, at the place where they are executed. If they are inlined 
twice, they should be listed twice.

That sounds like it would ultimately be confusing. An inlined piece of code might be inlined in hundreds of places.

In general, my expectation of optimization is that it happens behind the scenes and doesn't change visible behavior. A huge growth in the compiler listing is probably not what people want.

Also, once a piece of code is inlined, other optimizations are opened to the compiler.

- The compiler might know some input parameters, so parts of the code are redundant and can be removed, loops can be unrolled etc.

- Statements can be reordered - parts of the inlined code might be moved outside loops in the calling code

- The compiler might even swap the order of inner/outer loops, so that part of the calling code ends up inside a loop in the inlined section of code

These would be very difficult to reflect in a compiler listing (and are the reasons debugging optimized code is problematic).

--
Andrew Rowley
Black Hill Software

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