Summary: | ICE (Segmentation fault) in mips_split_move | ||||||
---|---|---|---|---|---|---|---|
Product: | Sisyphus | Reporter: | Ivan A. Melnikov <iv> | ||||
Component: | gcc9 | Assignee: | Gleb F-Malinovskiy <glebfm> | ||||
Status: | NEW --- | QA Contact: | qa-sisyphus | ||||
Severity: | normal | ||||||
Priority: | P3 | CC: | glebfm | ||||
Version: | unstable | ||||||
Hardware: | mipsel | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
Ivan A. Melnikov
2019-11-25 12:48:00 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. > $ 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.
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. |