https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115390
--- Comment #2 from anlauf at gcc dot gnu.org ---
Slightly rewritten (we only need the interface of foo):
module test
implicit none
interface
subroutine foo(s)
character(*), intent(in) :: s
end subroutine foo
end interface
contains
subroutine bar(s) bind(c)
character(*), intent(in) :: s
call foo(s)
end
end
This gives:
__attribute__((fn spec (". r ")))
void bar (struct CFI_cdesc_t00 & restrict _s)
{
integer(kind=8) s.0;
character(kind=1)[1:s.0] * s;
bitsizetype D.4279;
sizetype D.4280;
D.4279 = (bitsizetype) (sizetype) NON_LVALUE_EXPR <s.0> * 8;
D.4280 = (sizetype) NON_LVALUE_EXPR <s.0>;
s.0 = (integer(kind=8)) _s->elem_len;
s = (character(kind=1)[1:s.0] *) _s->base_addr;
foo ((character(kind=1)[1:s.0] *) s, s.0);
}