-
Notifications
You must be signed in to change notification settings - Fork 30
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
VariablesAccessInfo (dependence analysis) does not handle symbols with UNKNOWN access. #2863
Comments
In addition, if a CodeBlock contains an intrinsic function call such as |
See also #2825 (comment) |
The test for this functionality is in psyir/nodes/codeblock_test.py::test_codeblock_ref_accesses and contains: def test_codeblock_ref_accesses(parser):
'''Test that the reference_accesses() method works as expected.
TODO #2863 - accesses within a CodeBlock should really be marked as
AccessType.UNKNOWN but are currently always READWRITE. Also, calls to
Fortran intrinsics are not captured.
'''
vai = VariablesAccessInfo()
reader = FortranStringReader('''
subroutine mytest
that_is_true = .TRUE._bool_kind
hello_str = char_kind_"hello"
my_cmplx = (1.0_c_def, 1.0_b_def)
myloop: DO i = 1, 10_i_def
a = b + sqrt(c) + 1.0_r_def
myifblock: IF(this_is_true)THEN
EXIT myloop
ELSE IF(that_is_true)THEN myifblock
call my_routine()
write(*,*) "Bye"
ELSE myifblock
write(*,*) "hello"
END IF myifblock
END DO myloop
end subroutine mytest''')
prog = parser(reader)
block = CodeBlock(prog.children, CodeBlock.Structure.STATEMENT)
block.reference_accesses(vai)
all_sigs = vai.all_signatures |
In #2825 we realised that although we have
AccessType.UNKNOWN
, this is never referenced by VariablesAccessInfo. This is dangerous as it means the dependence analysis ignores symbols with this type of access whereas, we should handle them as "worst case" (whatever that happens to be).The text was updated successfully, but these errors were encountered: