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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |middle-end
            Summary|[8 regression] r276673      |[8/9/10 regression] r276673
                   |causes segfault in          |causes segfault in
                   |gfortran.dg/pr51434.f90     |gfortran.dg/pr51434.f90

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I have bisected up to current trunk (r277486), and I now find that
the test case fails at -O2 on gcc135 when compiled by hand:

[tkoenig@gcc135 ~]$ gfortran  -O2 pr51434.f90 
[tkoenig@gcc135 ~]$ ./a.out

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7fff863304d7 in ???
#1  0x10000634 in ???
#2  0x7fff85db527f in ???
Speicherzugriffsfehler

It does _not_ fail within the testsuite (which is why we do not see
this in the test results):

[tkoenig@gcc135 gcc]$ make check-gfortran RUNTESTFLAGS="dg.exp=pr51434.f90"
rm -rf testsuite/gfortran-parallel
make[1]: Entering directory `/home/tkoenig/trunk-bin/gcc'
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd ../../trunk/gcc; ${PWDCMD-pwd}` ; export srcdir ; \
if [ -n "" ] \
   && [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] \
   && [ -f testsuite/gfortran-parallel/finished ]; then \
  rm -rf testsuite/gfortran; \
else \
  cd testsuite/gfortran; \
  rm -f tmp-site.exp; \
  sed '/set tmpdir/ s|testsuite$|testsuite/gfortran|' \
        < ../../site.exp > tmp-site.exp; \
  /bin/sh ${srcdir}/../move-if-change tmp-site.exp site.exp; \
  EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ; \
  if [ -f ${rootme}/../expect/expect ] ; then  \
    TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
    export TCL_LIBRARY ; \
  fi ; \
  `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool gfortran
dg.exp=pr51434.f90; \
  if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
    touch ${rootme}/testsuite/gfortran-parallel/finished; \
  fi ; \
fi )
WARNING: Couldn't find the global config file.
Test Run By tkoenig on Sun Oct 27 18:10:53 2019
Native configuration is powerpc64le-unknown-linux-gnu

                === gfortran tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/tkoenig/trunk/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /home/tkoenig/trunk/gcc/testsuite/gfortran.dg/dg.exp ...

                === gfortran Summary ===

# of expected passes            12
/home/tkoenig/trunk-bin/gcc/testsuite/gfortran/../../gfortran  version 10.0.0
20191027 (experimental) (GCC) 

The log file shows:

Executing on host:
/home/tkoenig/trunk-bin/gcc/testsuite/gfortran/../../gfortran
-B/home/tkoenig/trunk-bin/gcc/testsuite/gfortran/../../
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/
/home/tkoenig/trunk/gcc/testsuite/gfortran.dg/pr51434.f90 
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never  -fdiagnostics-urls=never    -O2   -pedantic-errors 
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libatomic/.libs
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs 
-lm    -o ./pr51434.exe    (timeout = 300)
spawn -ignore SIGHUP
/home/tkoenig/trunk-bin/gcc/testsuite/gfortran/../../gfortran
-B/home/tkoenig/trunk-bin/gcc/testsuite/gfortran/../../
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/
/home/tkoenig/trunk/gcc/testsuite/gfortran.dg/pr51434.f90
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-urls=never -O2 -pedantic-errors
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libatomic/.libs
-B/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs
-L/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs -lm
-o ./pr51434.exe
PASS: gfortran.dg/pr51434.f90   -O2  (test for excess errors)
Setting LD_LIBRARY_PATH to
.:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libatomic/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs:/home/tkoenig/trunk-bin/gcc:.:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libgfortran/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libatomic/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs:/home/tkoenig/trunk-bin/powerpc64le-unknown-linux-gnu/./libquadmath/.libs:/home/tkoenig/trunk-bin/gcc:/home/tkoenig/lib64
spawn [open ...]
PASS: gfortran.dg/pr51434.f90   -O2  execution test

Also, it does not fail on x64_64.

Is there something about DECL_ARTIFICIAL that does not work with
initializers, but only on certain archirectures?

This looks a bit like a middle end problem to me, now.

Setting this to a 8/9/10 regression, and assigning to middle end.
If this turns out to be something Fortran-specific, please change
back.

Reply via email to