Skip to content
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

Bug in MA02ID.f #111

Closed
repagh opened this issue May 1, 2020 · 2 comments
Closed

Bug in MA02ID.f #111

repagh opened this issue May 1, 2020 · 2 comments

Comments

@repagh
Copy link
Member

repagh commented May 1, 2020

gcc 10 spits out the following warning

[590/952] Building Fortran object slycot/CMakeFiles/_wrapper.dir/src/MA02ID.f.o
../../../slycot/src/MA02ID.f:188:21:

  184 |          DO 90 J = 1, N+1
      |                                                                        2
......
  188 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                     1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:188:34:

  184 |          DO 90 J = 1, N+1
      |                                                                        2
......
  188 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                                  1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:230:21:

  226 |          DO 160 J = 1, N+1
      |                                                                        2
......
  230 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                     1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:230:34:

  226 |          DO 160 J = 1, N+1
      |                                                                        2
......
  230 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                                  1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)

These specific pieces of code are not used (no wrapper, not internally in SLICOT), but it looks plain wrong. Reporting this to not forget.

@bnavigator
Copy link
Collaborator

Slycot/slycot/src/MA02ID.f

Lines 184 to 188 in 003a2af

DO 90 J = 1, N+1
DO 70 I = 1, J-2
TEMP = ABS( QG(I,J) )
DWORK(I) = DWORK(I) + TEMP
DWORK(J-1) = DWORK(J-1) + TEMP

Slycot/slycot/src/MA02ID.f

Lines 226 to 230 in 003a2af

DO 160 J = 1, N+1
DO 140 I = 1, J-2
TEMP = ABS( QG(I,J) )
DWORK(I) = DWORK(I) + TEMP
DWORK(J-1) = DWORK(J-1) + TEMP

The 70 and 140 loops are inactive for 1 > J-2 because the iteration count is zero.

@repagh
Copy link
Member Author

repagh commented May 3, 2020

OK. Thanks, false alarm thus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants