Bug 37538 - ICE (Segmentation fault) in mips_split_move
Summary: ICE (Segmentation fault) in mips_split_move
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: gcc9 (show other bugs)
Version: unstable
Hardware: mipsel Linux
: P3 normal
Assignee: Gleb F-Malinovskiy
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-25 12:48 MSK by Ivan A. Melnikov
Modified: 2019-11-25 13:18 MSK (History)
1 user (show)

See Also:


Attachments
Reproducer (879.48 KB, application/gzip)
2019-11-25 13:07 MSK, Ivan A. Melnikov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2019-11-25 12:48:00 MSK
When building netsurf-3.9-alt1.src.rpm on mipsel, the compiler fails with the following messages:

[...]
 COMPILE: content/handlers/javascript/duktape/duktape.c
during RTL pass: split2
content/handlers/javascript/duktape/duktape.c: In function 'duk__convert_to_func_template':
content/handlers/javascript/duktape/duktape.c:65975:1: internal compiler error: Segmentation fault
65975 | }
      | ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.altlinux.org> for instructions.
[...]

Similar errors were observed while building qt5-3d-5.12.5-alt1.src.rpm:

g++ -c -pipe -frecord-gcc-switches -Wall -g -O2 -fPIC -DPIC -O2 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Wno-deprecated-copy -Wno-redundant-move -Wno-format-overflow -Wno-init-list-lifetime -D_REENTRANT -fPIC -DQT3DINPUT_LIBRARY -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_3DINPUT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_3DCORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ifrontend -Ibackend -I../../include -I../../include/Qt3DInput -I../../include/Qt3DInput/5.12.5 -I../../include/Qt3DInput/5.12.5/Qt3DInput -I../../include/Qt3DCore/5.12.5 -I../../include/Qt3DCore/5.12.5/Qt3DCore -I../../include/Qt3DCore -isystem /usr/include/qt5/QtGui/5.12.5 -isystem /usr/include/qt5/QtGui/5.12.5/QtGui -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore/5.12.5 -isystem /usr/include/qt5/QtCore/5.12.5/QtCore -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I.moc -I/usr/lib/qt5/mkspecs/linux-g++ -o .obj/abstractaxisinput.o backend/abstractaxisinput.cpp
during RTL pass: split2
backend/abstractaxisinput.cpp: In member function 'virtual void Qt3DInput::Input::AbstractAxisInput::initializeFromPeer(const QNodeCreatedChangeBasePtr&)':
backend/abstractaxisinput.cpp:66:1: internal compiler error: Segmentation fault
   66 | }
      | ^
libbacktrace could not find executable to open

... qt5-webengine and a couple of other packages.

When cpp9-debuginfo and gcc9-debuginfo are installed, I'm also getting the backtrace from the compiler:

during RTL pass: split2
d2.c: In function 'duk__convert_to_func_template':
d2.c:70170:1: internal compiler error: Segmentation fault
70170 | }
      | ^
0x71efc3 crash_signal
        ../../gcc/toplev.c:326
0x13bdc15 mips_split_move(rtx_def*, rtx_def*, mips_split_type, rtx_def*)
        ../../gcc/config/mips/mips.c:4865
0x142884f gen_split_59(rtx_insn*, rtx_def**)
        ../../gcc/config/mips/mips.md:5248
0x10a716b split_3
        ../../gcc/config/mips/mips.md:5246
0x10a716b split_insns(rtx_def*, rtx_insn*)
        ../../gcc/config/mips/mips.md:7019
0xb85a6f try_split(rtx_def*, rtx_insn*, int)
        ../../gcc/emit-rtl.c:3851
0xd16903 split_insn
        ../../gcc/recog.c:2901
0xd16903 split_all_insns()
        ../../gcc/recog.c:3005
0x130be43 execute
        ../../gcc/recog.c:3905
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugzilla.altlinux.org> for instructions.
Comment 1 Ivan A. Melnikov 2019-11-25 13:07:33 MSK
Created attachment 8420 [details]
Reproducer

I'm attaching the (compressed) source that triggers the bug. It's not fully preprocessed, I just included manually a couple of headers to make it self-contained. I was hoping to make it smaller eventually.

Just install gcc and gcc9 (cpp9-debuginfo and gcc9-debuginfo too, if you want)  and run

$ cc -O2 -c d2.c
during RTL pass: split2
d2.c: In function ‘duk__convert_to_func_template’:
d2.c:70170:1: internal compiler error: Segmentation fault
70170 | }
      | ^
0x71efc3 crash_signal
        ../../gcc/toplev.c:326
0x13bdc15 mips_split_move(rtx_def*, rtx_def*, mips_split_type, rtx_def*)
        ../../gcc/config/mips/mips.c:4865
0x142884f gen_split_59(rtx_insn*, rtx_def**)
        ../../gcc/config/mips/mips.md:5248
0x10a716b split_3
        ../../gcc/config/mips/mips.md:5246
0x10a716b split_insns(rtx_def*, rtx_insn*)
        ../../gcc/config/mips/mips.md:7019
0xb85a6f try_split(rtx_def*, rtx_insn*, int)
        ../../gcc/emit-rtl.c:3851
0xd16903 split_insn
        ../../gcc/recog.c:2901
0xd16903 split_all_insns()
        ../../gcc/recog.c:3005
0x130be43 execute
        ../../gcc/recog.c:3905
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugzilla.altlinux.org> for instructions.
$ cc --version
mipsel-alt-linux-gcc (GCC) 9.2.1 20190827 (ALT Sisyphus_mipsel 9.2.1-alt2.0.mips1)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 2 Ivan A. Melnikov 2019-11-25 13:11:45 MSK
> $ cc -O2 -c d2.c

`cc -O1 -c d2.c` works just fine, as well as -O0. I discovered that, in addition to the optimization enabled by -O1, -fisolate-erroneous-paths-dereference is the one flag that is required to trigger the crash. That is, `cc -O2 -fno-isolate-erroneous-paths-dereference  -c d2.c` works, but `cc -O1 -fisolate-erroneous-paths-dereference  -c d2.c` crashes.
Comment 3 Ivan A. Melnikov 2019-11-25 13:18:14 MSK
I think something like this

http://git.altlinux.org/people/iv/packages/?p=gcc9.git;a=commitdiff;h=041de9bb08f033d07b070cba142f99e563966707

should fix the problem -- at least netsurf builds and seems to work. I'll give it a bit more testing.