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

--- Comment #6 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
So the var_decl in question is fpstate.0:

 <var_decl 0x1034e1200 fpstate.0
    type <array_type 0x1036c4b28
        type <integer_type 0x1035003f0 c_char public unsigned QI
            size <integer_cst 0x1034bce70 constant 8>
            unit-size <integer_cst 0x1034bce88 constant 1>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x1035003f0 precision:8 min <integer_cst 0x1034bced0 0> max <integer_cst
0x1034bceb8 255>
            pointer_to_this <pointer_type 0x103503bb8>>
        BLK
        size <integer_cst 0x103546988 constant 264>
        unit-size <integer_cst 0x103546aa8 constant 33>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x1036c4b28
        domain <integer_type 0x1036c4a80 type <integer_type 0x1035007e0>
            DI
            size <integer_cst 0x1034bcd80 constant 64>
            unit-size <integer_cst 0x1034bcd98 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x1036c4a80 precision:64 min <integer_cst 0x1034bd050 0> max <integer_cst
0x103546a60 32>>
        pointer_to_this <pointer_type 0x1036c4bd0>>
    addressable used ignored BLK s.f90:10:17 size <integer_cst 0x103546988 264>
unit-size <integer_cst 0x103546aa8 33>
    align:8 warn_if_not_align:0 context <function_decl 0x1036c8100 my_sub>>

And if I look at the tree dump, it seems the variable is indeed not created
correctly:

__attribute__((fn spec (". w ")))
void my_sub (struct __class_my_mod_My_type_t & restrict obs)
{
  try
    {
      _gfortran_ieee_procedure_entry ((void *) &fpstate.0);

see the missing declaration for fpstate.0. But it is created by
gfc_create_var(), like so many other local variables in the front-end, so I
have no idea why it's disappearing.

Reply via email to