public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/110996] New: RISC-V vector Fortran: SEGV ICE during parsing
@ 2023-08-11 15:59 jeremy.bennett at embecosm dot com
  2023-08-12  2:35 ` [Bug fortran/110996] " juzhe.zhong at rivai dot ai
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jeremy.bennett at embecosm dot com @ 2023-08-11 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110996
           Summary: RISC-V vector Fortran: SEGV ICE during parsing
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jeremy.bennett at embecosm dot com
  Target Milestone: ---

Created attachment 55726
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55726&action=edit
Fortran 90 source code for the test case

This appears to be a failure in the Fortran parser, which only occurs if the
RISC-V vector ISA extension is specified.

This is the reproducer (testcase.f90):

  CONTAINS
   SUBROUTINE a
   END
   SUBROUTINE b
   END
   SUBROUTINE c(d) e
SUBROUTINE f
      END
END

(which has a syntax error with the stray "e" at the end of the declaration of
"SUBROUTINE c").

This is compiled with:

riscv64-unknown-linux-gnu-gfortran -march=rv64gcv -mabi=lp64d -c \
    -Ofast testcase.f90

NOTE. The error only occurs if the "v" extensions is specified in the "-march"
string.

The output is:

testcase.f90:6:20:

    6 |    SUBROUTINE c(d) e
      |                    1
Error: Syntax error in SUBROUTINE statement at (1)
f951: internal compiler error: Segmentation fault
0x112a263 crash_signal
        /home/jeremy/gittrees/mustang/gcc/gcc/toplev.cc:314
0x7fdd1203c4af ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xaaea0a resolve_symbol
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/resolve.cc:16643
0xadadc2 do_traverse_symtree
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/symbol.cc:4190
0xab95ed resolve_types
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/resolve.cc:17963
0xab9697 resolve_types
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/resolve.cc:17977
0xac08ec gfc_resolve(gfc_namespace*)
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/resolve.cc:18083
0xa9f250 resolve_all_program_units
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/parse.cc:6909
0xa9f250 gfc_parse_file()
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/parse.cc:7165
0xaf3533 gfc_be_parse_file
        /home/jeremy/gittrees/mustang/gcc/gcc/fortran/f95-lang.cc:229
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

System information
------------------

Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gfortran
COLLECT_LTO_WRAPPER=/home/jeremy/gittrees/mustang/install/libexec/gcc/riscv64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/jeremy/gittrees/mustang/gcc/configure
--target=riscv64-unknown-linux-gnu
--prefix=/home/jeremy/gittrees/mustang/install
--with-sysroot=/home/jeremy/gittrees/mustang/install/sysroot
--with-pkgversion=g68783211f66 --with-system-zlib --enable-shared --enable-tls
--enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp
--disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap
--src=/home/jeremy/gittrees/mustang/gcc --enable-multilib --with-abi=lp64d
--with-arch=rv64gc --with-tune= --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2
   -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medany'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230811 (experimental) (g68783211f66)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-09-15 17:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 15:59 [Bug fortran/110996] New: RISC-V vector Fortran: SEGV ICE during parsing jeremy.bennett at embecosm dot com
2023-08-12  2:35 ` [Bug fortran/110996] " juzhe.zhong at rivai dot ai
2023-08-13 19:35 ` anlauf at gcc dot gnu.org
2023-08-14 14:56 ` jeremy.bennett at embecosm dot com
2023-08-15  1:54 ` juzhe.zhong at rivai dot ai
2023-08-17 19:49 ` mikael at gcc dot gnu.org
2023-08-22  8:00 ` mikael at gcc dot gnu.org
2023-08-22  8:14 ` juzhe.zhong at rivai dot ai
2023-08-22 19:03 ` mikael at gcc dot gnu.org
2023-08-26 20:04 ` mikael at gcc dot gnu.org
2023-09-12  8:24 ` cvs-commit at gcc dot gnu.org
2023-09-12  8:33 ` mikael at gcc dot gnu.org
2023-09-15 17:27 ` mikael at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).