BT_UNKNOWN in IF statement condition expression

Francisco Marchena francisco.marchena@codethink.co.uk
Fri May 25 11:03:00 GMT 2018


On 2018-05-24 16:31, Steve Kargl wrote:
> 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.

Hey Steve,

Thanks for the advice, it helped me find exactly where to do the check.

Best Regards,
Fran

-- 
Francisco Redondo Marchena     https://www.codethink.co.uk/
Privacy notice:   https://www.codethink.co.uk/privacy.html



More information about the Fortran mailing list