BT_UNKNOWN in IF statement condition expression

Steve Kargl sgk@troutmask.apl.washington.edu
Thu May 24 15:31:00 GMT 2018


On Thu, May 24, 2018 at 03:31:40PM +0100, Francisco Marchena wrote:
> 
> I am investigating how IF statements (and blocks) are resolved in 
> gfortran and have come across an issue in both match.c and parse.c: If 
> the condition expression contains an intrinsic, then the type of the 
> condition expression is set to BT_UNKNOWN.
> 
> The issue is that I'm trying to write a patch to allow numeric if 
> conditions to be cast to LOGICAL for DEC compatibility, but obviously 
> this is impossible to do when faced with BT_UNKNOWN.
> 
> I have included a patch which exhibits this behaviour in upstream 
> gfortran.
> 
> Any ideas?
> 

I haven't studied your patch and example in detail, so I 
could be off a bit here.  gfortran does quite a bit of
work in resolve.c to well resolve things like BT_UNKNOWN.
I suspect that what you want to do needs to be done in
resolve.c.  I suspect you'll need to inspect locations
where EXEC_IF appears in the source code.

-- 
Steve



More information about the Fortran mailing list