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

            Bug ID: 118432
           Summary: Test cases failing when gfc_code.ext is turned into a
                    struct
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

Turning gfc_code.ext into a struct is wasteful of memory, but it
can be used to find problems where the compiler depends on
accidental initialization.

With the patch

diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index aa495b5487e..554ad5da16d 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -3125,7 +3125,7 @@ typedef struct gfc_code
   gfc_symbol *resolved_sym;
   gfc_intrinsic_sym *resolved_isym;

-  union
+  struct
   {
     gfc_actual_arglist *actual;
     gfc_iterator *iterator;

quite a few test cases fail, all of them with segmentation
violations in the compiler:

gfortran.dg/dec_io_1.f90
gfortran.dg/dec_io_2.f90
gfortran.dg/dec_io_6.f90
gfortran.dg/dec_io_7.f90
gfortran.dg/do_check_9.f90
gfortran.dg/dtio_15.f90
gfortran.dg/f2003_inquire_1.f03
gfortran.dg/filename_null.f90
gfortran.dg/g77/19990419-0.f
gfortran.dg/inquire_10.f90
gfortran.dg/inquire_11.f90
gfortran.dg/inquire_12.f90
gfortran.dg/inquire_13.f90
gfortran.dg/inquire_15.f90
gfortran.dg/inquire_16.f90
gfortran.dg/inquire_17.f90
gfortran.dg/inquire_18.f90
gfortran.dg/inquire_19.f90
gfortran.dg/inquire_5.f90
gfortran.dg/inquire_6.f90
gfortran.dg/inquire_7.f90
gfortran.dg/inquire_9.f90
gfortran.dg/inquire.f90
gfortran.dg/inquire_internal.f90
gfortran.dg/inquire_pre.f90
gfortran.dg/inquire_recl_f2018.f90
gfortran.dg/inquire_size.f90
gfortran.dg/io_constraints_10.f90
gfortran.dg/io_constraints_11.f90
gfortran.dg/io_constraints_12.f90
gfortran.dg/io_constraints_13.f90
gfortran.dg/io_constraints_7.f03
gfortran.dg/io_constraints_8.f90
gfortran.dg/io_tags_5.f90
gfortran.dg/large_recl.f90
gfortran.dg/large_unit_1.f90
gfortran.dg/large_unit_2.f90
gfortran.dg/make_unit.f90
gfortran.dg/negative_unit.f
gfortran.dg/negative_unit_int8.f
gfortran.dg/open_errors.f90
gfortran.dg/open_negative_unit_1.f90
gfortran.dg/pr20950.f
gfortran.dg/pr88248.f90
gfortran.dg/streamio_10.f90
gfortran.dg/streamio_15.f90
gfortran.dg/streamio_16.f90
gfortran.dg/streamio_18.f90
gfortran.dg/streamio_3.f90
gfortran.dg/streamio_8.f90
gfortran.dg/unf_io_convert_4.f90
gfortran.fortran-torture/execute/inquire_1.f90
gfortran.fortran-torture/execute/inquire_2.f90
gfortran.fortran-torture/execute/inquire_3.f90
gfortran.fortran-torture/execute/inquire_4.f90
gfortran.fortran-torture/execute/inquire_5.f90
libgomp.fortran/async_io_1.f90
libgomp.fortran/rwlock_1.f90

This could be something working (under normal conditions) by accident
by aliasing

    gfc_open *open;
    gfc_close *close;
    gfc_filepos *filepos;
    gfc_inquire *inquire;
    gfc_wait *wait;

because all of these appear to be I/O related.

Reply via email to