Asher, everyone,
A series of patches by Andrew Pinski allow the middle-end to spot
type mismatches emitted by the front-end (see PR 22368 for
details). Among the problems revealed by this patch is the
following code: "loc(c) == 0", because the code returned by LOC is
unsigned, which is not what we should do. Indeed, the documentation
states that:
The return value is of type @code{INTEGER(n)}, where @code{n} is the
size (in bytes) of a memory address on the target machine.
So, I propose to change the gfc_trans_intrinsic_loc function to
that its result is fold_convert'ed to the right integer type. I
plan to commit the following patch on mainline next week-end unless
someone objects.
Regtested (with Andrew's patches) on i686-linux.
FX