http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57435

            Bug ID: 57435
           Summary: Ice on invalid: check_for_ambiguous
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugs at stellardeath dot org

Created attachment 30205
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30205&action=edit
Minimal test case

When trying to reduce a test-case with "delta", I stumbled upon this
(unrelated) invalid code-snippet that triggers an ICE:

> cat gfortran_check_for_ambiguous.f90
> ~/sys/bin/gfortran gfortran_check_for_ambiguous.f90
gfortran_check_for_ambiguous.f90:4.15:

  use precision
               1
Error: Unexpected USE statement in CONTAINS section at (1)
gfortran_check_for_ambiguous.f90:5.19:

module stressten_rt
                   1
Error: Unexpected MODULE statement in CONTAINS section at (1)
gfortran_check_for_ambiguous.f90:6.15:

  use precision
               1
Error: Unexpected USE statement in CONTAINS section at (1)
f951: internal compiler error: Segmentation fault
0x9b710f crash_signal
        ../.././gcc/toplev.c:333
0x5b4f13 check_for_ambiguous
        ../.././gcc/fortran/module.c:4535
0x5b4f13 read_module
        ../.././gcc/fortran/module.c:4731
0x5b4f13 gfc_use_module
        ../.././gcc/fortran/module.c:6406
0x5b73d3 gfc_use_modules()
        ../.././gcc/fortran/module.c:6530
0x5bc267 use_modules
        ../.././gcc/fortran/parse.c:86
0x5bdaf4 decode_statement
        ../.././gcc/fortran/parse.c:301
0x5bedf4 next_free
        ../.././gcc/fortran/parse.c:784
0x5bedf4 next_statement
        ../.././gcc/fortran/parse.c:977
0x5c165f parse_contained
        ../.././gcc/fortran/parse.c:4006
0x5c159e parse_progunit
        ../.././gcc/fortran/parse.c:4192
0x5c212a gfc_parse_file()
        ../.././gcc/fortran/parse.c:4597
0x5fe5a5 gfc_be_parse_file
        ../.././gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>


The gfortran version I used was a self-compiled version from trunk:

> ~/sys/bin/gfortran --version
GNU Fortran (GCC) 4.9.0 20130517 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING


It also seems to trigger an ICE in 4.8.0, but behaves correctly in 4.7.2.

Reply via email to