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
subroutine foo(str1)
character(len=5) :: str1
print *, str1
end subroutine
program test
integer(8) :: length
length = 5
call foo('flang')
end program test
When stopped at line 3 (print *, str1), here is what GDB shows
(gdb) info args
No arguments.
(gdb) ptype foo
type = void (void)
(gdb) info locals
str1 = 'flang'
The debug info is describing str1 as local and not argument. This makes function type wrong too.
This seems to happen because our detection of arguments depends on the memRef of the fir.declare being directly pointing at the BlockArgument. If there is any intermediate nodes like in this case (fir.unboxchar, fir.emboxchar) then this detection fails.
The text was updated successfully, but these errors were encountered:
@jeanPerier this is the problem which I mentioned in the comments in #112398 (comment) where having argument number on DeclareOp would save us from pattern matching IR.
subroutine foo(str1)
character(len=5) :: str1
print *, str1
end subroutine
program test
integer(8) :: length
length = 5
call foo('flang')
end program test
When stopped at line 3 (print *, str1), here is what GDB shows
(gdb) info args
No arguments.
(gdb) ptype foo
type = void (void)
(gdb) info locals
str1 = 'flang'
The debug info is describing str1 as local and not argument. This makes function type wrong too.
This seems to happen because our detection of arguments depends on the memRef of the fir.declare being directly pointing at the BlockArgument. If there is any intermediate nodes like in this case (fir.unboxchar, fir.emboxchar) then this detection fails.
subroutine foo(str1)
character(len=5) :: str1
print *, str1
end subroutine
program test
integer(8) :: length
length = 5
call foo('flang')
end program test
When stopped at line 3 (print *, str1), here is what GDB shows
(gdb) info args
No arguments.
(gdb) ptype foo
type = void (void)
(gdb) info locals
str1 = 'flang'
The debug info is describing str1 as local and not argument. This makes function type wrong too.
This seems to happen because our detection of arguments depends on the memRef of the fir.declare being directly pointing at the BlockArgument. If there is any intermediate nodes like in this case (fir.unboxchar, fir.emboxchar) then this detection fails.
Consider the following example code.
When stopped at line 3 (print *, str1), here is what GDB shows
The debug info is describing
str1
as local and not argument. This makes function type wrong too.This seems to happen because our detection of arguments depends on the
memRef
of the fir.declare being directly pointing at theBlockArgument
. If there is any intermediate nodes like in this case (fir.unboxchar, fir.emboxchar
) then this detection fails.The text was updated successfully, but these errors were encountered: