<div dir="ltr"><div dir="ltr"><div></div><div>Yep, I think wasn't clear enough when I said "an integer parameter to discriminate". Perhaps an example may help</div><div style="margin-left:40px"><br></div><div style="margin-left:40px">module moo<br>contains<br>    function bad_cos(x) result(y)<br>        real, value :: x   ! degrees<br>        real :: y<br>        real, parameter :: pi = 3.14159265359<br><br>        x = x + pi / 2<br><br>        entry bad_sin(x) <br><br>        y = ...<br><br>    end function bad_cos<br>end module moo<br><br>program main<br>    use moo<br>    implicit none<br><br>    real :: c, s<br>    <br>    c = bad_cos(0.6)<br>    s = bad_sin(0.6)<br><br>    print *, c, s, c**2 + s**2<br>end program main</div><div><br></div>the code above might be lowered into something like<br></div><div><div style="margin-left:40px"><br></div><div style="margin-left:40px">float moo_bad_cos__(float x, int discriminator)<br>{</div><div style="margin-left:40px">  switch (discriminator) {<br></div><div style="margin-left:40px">   case 0: goto moo_bad_cos;<br></div><div style="margin-left:40px">   case 1: goto moo_bad_sin;<br>  }<br></div><div style="margin-left:40px">moo_bad_cos:<br></div><div style="margin-left:40px">   x = x - pi;<br></div><div style="margin-left:40px">moo_bad_sin:</div><div style="margin-left:40px">  y = ...;<br></div><div style="margin-left:40px">  return y;<br>}<br><br></div><div style="margin-left:40px">int main() {<br></div><div style="margin-left:40px">   float c = moo_bad_cos__(0.6, 0);<br></div><div style="margin-left:40px">   float s = moo_bad_cos__(0.6, 1);</div><div style="margin-left:40px"><br></div><div style="margin-left:40px">  // print etc.<br></div><div style="margin-left:40px">}</div><div style="margin-left:40px"><br></div>I'm afraid I don't know enough about the consequences of describing the ENTRY as a subprogram of its own in the debug info, so apologies if what follows is unrelated to that.<br></div><div><br></div><div>In my (definitely biased) view of the Fortran things, I'd probably be OK if the debugger knows I'm inside (the original) "bad_cos" given that an ENTRY statement is always going to be found inside a function/procedure (where the enclosing function/procedure acts as the "principal" entry), so it would surprise me a bit if the debugger thinks I'm in a function called "bad_sin" as I don't have any procedure (at least at the "program function" or "module procedure", in Fortran parlance, level) with that name in the code. But that's my view.</div><div><br></div><div>Perhaps flang/f18 folks want to weigh in here.<br></div><div><br></div><div>Kind regards,</div><div>Roger<br></div></div><br><div class="gmail_quote"><div dir="ltr">Missatge de Krzysztof Parzyszek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> del dia dt., 23 d’oct. 2018 a les 18:31:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/23/2018 11:21 AM, via llvm-dev wrote:<br>
> Interesting. So the FORTRAN subprogram would have an implicit parameter <br>
> and effectively have a computed GOTO at the beginning to dispatch to the <br>
> correct ENTRY?<br>
<br>
At least in Fortran 77, each ENTRY has its own name, so there is no <br>
"dynamic dispatch". They are really more like separate functions with a <br>
common tail.<br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,<br>
hosted by The Linux Foundation<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Roger Ferrer Ibáñez<br></div>