Clang uses signext/zeroext attributes for integer arguments shorter than
the default 'int' type on a target. So Flang has to match this for functions
from Fortran runtime and also for BIND(C) routines. This patch implements
ABI adjustments only for Fortran runtime calls. BIND(C) part will be done
separately.
This resolves https://github.com/llvm/llvm-project/issues/58579
I've been chasing segfaults caused by this commit in Windows ARM buildbot (e.g. https://lab.llvm.org/buildbot/#/builders/65/builds/7378).
It seems that the piece of code below is not working correctly:
The printout is:
Note the 3rd dump: it means the newTy was created as if the range held tupleTy and eleTy. So range is obviously pointing to the stack in a wrong way. Without my modifications we end up creating a TupleType with junk component types - this breaks everything after that.
I do not think the lifetime extension for the temporary underlying array of the initializer_list applies in this case, so all these range uses in the file seem to be invalid. I am not sure why my changes trigger the error. My only guess is that adding more virtual methods into the base class somehow affected optimizations.
I can get clean check-flang after fixing all instances of such TypeRange usage, so this is what I am going to do to finally make progress with this commit.