Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

Enabling Array bounds checking causes 300% executable size increase

Greetings,

I notice that when the /check:bounds flag is set the program size increases dramatically (from 9 MB to 22 MB).  What can be done to lessen this?

Thanks,

Bryan

0 Kudos
5 Replies
Highlighted

If you have a lot of array

If you have a lot of array references and multidimensional arrays, that's a lot of checking code, plus inhibited optimizations (assuming enabled) due to branches and more intermediate language. What problem does this cause for you?

Retired 12/31/2016
0 Kudos
Highlighted
Beginner

Greetings Steve,

Greetings Steve,

Thanks for the quick response!  The main issue I am encountering is having to justify to QA why the program size is changing when migrating programs from CVF.

I tested an old Compaq Visual Compiler 6.5 install and the switch to enable array abounds and it only increased it by 30% not 300% like IVF.  The new messages are more specific and useful, but at the cost of program size.

  CVF 6.5: forrtl: severe (161): Program Exception - array bounds exceeded

  IVF 16.0: forrtl: severe (408): fort: (2): Subscript #2 of the array SPAN has value 102 which is greater than the upper bound of 101

 

Opening up the IVF generated EXE in a text editor I see format statements like: "fort: (%d): Dummy character variable '%s' has length %ld which is greater than actual variable length %ld" repeated thousands of times.  Is this expected?  Is there a way to reduce the impact?

Thanks again,

Bryan

0 Kudos
Highlighted

Interesting. I didn't expect

Interesting. I didn't expect that at all, but I can reproduce it. I thought we had dealt with this years ago. Let me check with the developers.

Retired 12/31/2016
0 Kudos
Highlighted

Escalated as issue

Escalated as issue DPD200414349. To my mind, this text doesn't belong in the generated code at all. We have a message catalog used for run-time errors (that also gets translated to Japanese.) Thanks for bringing this to our attention.

Retired 12/31/2016
0 Kudos
Highlighted

It turns out I was mistaken

It turns out I was mistaken when I thought I had reproduced the problem - I didn't notice that we generate two message templates that have different wording. These are created only once per program unit.

If you have a test case that shows more than one set of texts per program unit (subroutine, function, etc.) please attach it. Otherwise I would suggest that the difference lies elsewhere.

Retired 12/31/2016
0 Kudos