On Fri, Dec 02, 2016 at 04:47:19PM +0100, Janus Weil wrote: > Hi Steve, > > 2016-12-02 2:33 GMT+01:00 Steve Kargl <s...@troutmask.apl.washington.edu>: > > The attached patch fixes an ICE, a nearby whitespace issue, and > > removed the ATTRIBUTE_UNUSED tag. THe change has passed regression > > testing on x86_64-*-freebsd. Ok to commit? > > huh, I don't really understand why the argument of RANK is detected to > be an EXPR_FUNCTION for the test case at hand. Shouldn't it rather be > an EXPR_CONSTANT? > > Some debugging in gfc_check_rank shows that a->symtree->n.sym indeed > is the symbol "c" (as expected), but that clearly is not a function, > so it seems to me that the actual bug here is that a->expr_type is set > incorrectly ...? >
I found that it is the function __convert_s4_s1. Namely, we have character, parameter :: c = char(256,4) print *, rank(c) c is kind=1 and char(256,4) is kind 4. so, we end up with print *, rank(__convert_s4_s1(...)) As __convert_s4_s1() has neither isym nor esym set, you get a problem. -- Steve