[J3] lbound / ubound undefined behaviour?

Nathan Sircombe Nathan.Sircombe at arm.com
Thu Jun 27 15:46:10 UTC 2024


Hi,

I’ve got a question from one of the engineers in the compiler team here – I’d appreciate the J3 list’s opinion (actually some of the list are on the original fortran-lang thread).

The problem was initially discussed here: https://fortran-lang.discourse.group/t/an-interesting-difference-between-compilers/7131
The initial conclusion seems to be that compilers from group "B” have the wrong end of the stick. But a separate discussion on the Flang github reached a different conclusion: https://github.com/flang-compiler/flang/issues/1435. Claiming that we are facing undefined behaviour and various compilers handle this situation differently.
So, is it actually undefined behaviour and the compilers have liberty in handling it their own way? or it is clearly defined what the compilers should do?

Cheers,
Nathan.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20240627/4c30d2b1/attachment.htm>


More information about the J3 mailing list