https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77278

--- Comment #20 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, the mismatched declaration types are:
void <T67d> (struct array01_integer(kind=4) &, float & restrict,
logical(kind=4) *)
and
void <T621> (struct gfc_array_i4 * restrict, struct gfc_array_r4 * restrict,
GFC_LOGICAL_4)

The mismatch happens in the last parameter that is logical(kind=4) and
GFC_LOGICAL_4.

 <pointer_type 0x7ffff6616d20
    type <boolean_type 0x7ffff6616c78 logical(kind=4) unsigned SI
        size <integer_cst 0x7ffff680cdb0 constant 32>
        unit-size <integer_cst 0x7ffff680cdc8 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6616c78 precision:1 min <integer_cst 0x7ffff6a088e8 0> max <integer_cst
0x7ffff6a08900 1>
        pointer_to_this <pointer_type 0x7ffff6616d20>>
    unsigned DI
    size <integer_cst 0x7ffff680cb70 type <integer_type 0x7ffff68210a8
bitsizetype> constant 64>
    unit-size <integer_cst 0x7ffff680cb88 type <integer_type 0x7ffff6821000
sizetype> constant 8>
    align:64 warn_if_not_align:0 symtab:0 alias-set 3 structural-equality>


 <enumeral_type 0x7ffff6a06f18 GFC_LOGICAL_4 unsigned SI
    size <integer_cst 0x7ffff680cdb0 type <integer_type 0x7ffff68210a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x7ffff680cdc8 type <integer_type 0x7ffff6821000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6821690 precision:32 min <integer_cst 0x7ffff680cde0 0> max <integer_cst
0x7ffff680cd98 4294967295> context <translation_unit_decl 0x7ffff68161e0
../../../ggdb3/libgfortran/generated/minloc0_4_r4.c>
    pointer_to_this <pointer_type 0x7ffff6616690>>

So mixing up enum and pointer to enum.
Fixing C source to expect pointer to enum makes warning to go away, but looking
at the gimple produced, it really just seems in bug in fortran FE declaring the
function incorrectly? It seems to really just pass 0 instead of pointer to 0:
_gfortran_minloc0_4_r4 (&parm.1, _40, 0);

Honza

Reply via email to