-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Mbounds reports false positive for array slices passed to DOT_PRODUCT intrinsic #1238
Comments
To be clear, when Note that the false positive occurs only if we invoke the compilers with For your reference, see what I reported to NVIDIA before in “Bug of nvfortran 22.2-0: array subscript triplet handled wrongly”, in case they are related. [Update 20230526: They turn out to be different bugs.] |
@mleair Do you have any information on the NVIDIA bug? Is that fix applicable to open-source Flang? |
The fix checks for an empty section under the A_SUBSCR case in collapse_assignment() in transfrm.c. The check looks like this:
Originally, the check looked like this:
The is_empty_section() function checks for a zero size array section. -Mark |
@mleair Thanks a lot Mark! Would it be possible for you guys to upstream that fix? 😄 |
@bryanpkc Sorry, I am too busy right now to implement, test, and upstream the fix. |
@bryanpkc I am available to answer any additional questions, though. |
FYI, the problem remains in |
This bug is the same as the following one in N.B.: It is DIFFERENT from the following one, which was mentioned earlier by me in this thread. |
hello @mleair, |
I looked at this problem briefly. I am not sure that Mark's proposed solution is relevant. The crux of the problem is that Classic Flang lacks proper bounds checking for array sections; a triple expression is handled incorrectly as if it is just a single subscript. An extension of the complicated logic in the |
…lang` in cmake*.yml due to flang-compiler/flang#1238
This is a bug that affects all flang-based compilers: classic flang 7.0.1, Huawei Bisheng flang 1.3.3, NVIDIA nvfortran 22.3, and AOCC 3.2.0 flang. They raise a false positive error of out-bound subscripts when invoked with the
-Mbounds
flag.Here is a minimal working example. The latest version of the code is available at my GitHub repo dedicated to testing Fortran compilers.
The error message looks like the following.
Thank you for having a look at it.
The text was updated successfully, but these errors were encountered: