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

            Bug ID: 128343
           Summary: [17 Regression] valgrind error in load_line(_IO_FILE*,
                    unsigned int**, int*, int const*) (scanner.cc:2042)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this Fortran source code:

#define a(i) b(i)
#if 0
#else ! a
      ! a
      write(10,*) a
      print *,'pass'
#endif ! a a
      end

from the Fujitsu test suite on Github, does this

$ ~/gcc/results.20261028.valgrind/bin/gfortran -c -w
/home/dcb42/fujitsu/trunk/Fortran/1066/1066_0007.f
==1082222== Invalid write of size 4
==1082222==    at 0x590ACB: load_line(_IO_FILE*, unsigned int**, int*, int
const*) (scanner.cc:2042)
==1082222==    by 0x595053: load_file(char const*, char const*, bool)
(scanner.cc:2637)
==1082222==    by 0x595FAB: gfc_new_file() (scanner.cc:2791)
==1082222==    by 0x5C397F: gfc_init() (f95-lang.cc:298)

Compiler is

$ ~/gcc/results.20261028.valgrind/bin/gfortran -v 
Using built-in specs.
COLLECT_GCC=/home/dcb42/gcc/results.20261028.valgrind/bin/gfortran
COLLECT_LTO_WRAPPER=/home/dcb42/gcc/results.20261028.valgrind/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk/configure
--prefix=/home/dcb42/gcc/results.20261028.valgrind --disable-bootstrap
--disable-doc --disable-fixincludes --disable-multilib
--with-pkgversion=8280b3ff920fc6b1 --enable-checking=valgrind
--enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20261028 (experimental) (8280b3ff920fc6b1) 
$

Reply via email to