Bug ID: 84511
           Summary: Internal compiler error from directly printing return
                    of C_LOC
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot
          Reporter: h.ratcliffe at warwick dot
  Target Milestone: ---

Created attachment 43487
Tarball of 2-file working example

Directly printing return from C_LOC causes an internal compiler error if C_LOC
is called on a type defined in a module in a separate file. Capturing the
return and then printing succeeds. 
Full error report is

f951: internal compiler error: Bad IO basetype (10)
0x5cbd3f gfc_internal_error(char const*, ...)
0x6bd3fe transfer_expr
0x6c0748 gfc_trans_transfer(gfc_code*)
0x6697a7 trans_code
0x6be1d6 build_dt
0x669787 trans_code
0x68e887 gfc_generate_function_code(gfc_namespace*)
0x66d1f9 gfc_generate_module_code(gfc_namespace*)
0x622f3b translate_all_program_units
0x622f3b gfc_parse_file()
0x66600f gfc_be_parse_file

Same error arises on gfortran 5.4 and 7.2.0 on Ubuntu and 6.3.0 on OSX, but
4.3.4 on SLES 11 (SP4) succeeds. 

The error does not occur if module TWO defining the type is in the file where
C_LOC is called.

Reply via email to