You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve WHERE handling to check the dimensions of full statements inside the condition, instead of just finding the first range object inside the statement.
#2876
Open
LonelyCat124 opened this issue
Jan 28, 2025
· 0 comments
PSyclone currently guesses the size of the WHERE loop by assessing the first range in the condition and assuming that is the dimension of the loop. This can lead to incorrect assessments in some cases, e.g. the WHERE statements found in this code fragment.
subroutine test
real, allocatable, dimension(:) :: pivot, pivot2
real :: min_pivot
min_pivot = 1.0
allocate(pivot(1:10000))
WHERE(sum(pivot(:)) + pivot(1:5) < min_pivot) pivot(1:5) = min_pivot
deallocate(pivot)
end subroutine
We can be smarter now, and evaluate the size of SUM - this first case is wrong technically but we currently do something wrong and turn pivot(1:5) to just index over the full range.
Also this statement will be wrong due to #2722 but thats a separate problem.
The text was updated successfully, but these errors were encountered:
PSyclone currently guesses the size of the WHERE loop by assessing the first range in the condition and assuming that is the dimension of the loop. This can lead to incorrect assessments in some cases, e.g. the WHERE statements found in this code fragment.
We can be smarter now, and evaluate the size of SUM - this first case is wrong technically but we currently do something wrong and turn
pivot(1:5)
to just index over the full range.Also this statement will be wrong due to #2722 but thats a separate problem.
The text was updated successfully, but these errors were encountered: