https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103915
Bug ID: 103915 Summary: [12 Regression] ICE: SIGSEGV in memory_operand with -flive-range-shrinkage Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz CC: ubizjak at gmail dot com Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 52129 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52129&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -flive-range-shrinkage testcase.c -wrapper valgrind,-q ==29614== Invalid read of size 2 ==29614== at 0x12BBDFA: memory_operand(rtx_def*, machine_mode) (recog.c:1812) ==29614== by 0x1AE5525: get_attr_memory(rtx_insn*) (i386.md:5096) ==29614== by 0x1EF0820: insn_default_latency_generic(rtx_insn*) (i386.md:19503) ==29614== by 0x231B911: insn_sched_cost(rtx_insn*) (haifa-sched.c:1421) ==29614== by 0x231FF12: dep_cost_1(_dep*, unsigned int) (haifa-sched.c:1474) ==29614== by 0x2321BD1: dep_cost (haifa-sched.c:1510) ==29614== by 0x2321BD1: priority(rtx_insn*, bool) [clone .part.0] (haifa-sched.c:1661) ==29614== by 0x23224C2: priority (haifa-sched.c:1593) ==29614== by 0x23224C2: set_priorities(rtx_insn*, rtx_insn*) (haifa-sched.c:7166) ==29614== by 0x13101E2: compute_priorities() (sched-rgn.c:3025) ==29614== by 0x1312EF5: schedule_region (sched-rgn.c:3118) ==29614== by 0x1312EF5: schedule_insns() [clone .part.0] (sched-rgn.c:3518) ==29614== by 0x13135AB: schedule_insns (sched-rgn.c:3504) ==29614== by 0x13135AB: rest_of_handle_live_range_shrinkage (sched-rgn.c:3706) ==29614== by 0x13135AB: (anonymous namespace)::pass_live_range_shrinkage::execute(function*) (sched-rgn.c:3793) ==29614== by 0x126BEEA: execute_one_pass(opt_pass*) (passes.c:2637) ==29614== by 0x126C7AF: execute_pass_list_1(opt_pass*) (passes.c:2737) ==29614== Address 0xabababababababab is not stack'd, malloc'd or (recently) free'd ==29614== during RTL pass: lr_shrinkage testcase.c: In function 'foo': testcase.c:7:1: internal compiler error: Segmentation fault 7 | } | ^ 0x1373cef crash_signal /repo/gcc-trunk/gcc/toplev.c:322 0x12bbdfa memory_operand(rtx_def*, machine_mode) /repo/gcc-trunk/gcc/recog.c:1812 0x1ae5525 get_attr_memory(rtx_insn*) /repo/gcc-trunk/gcc/config/i386/i386.md:5096 0x1ef0820 insn_default_latency_generic(rtx_insn*) /repo/gcc-trunk/gcc/config/i386/i386.md:19503 0x231b911 insn_sched_cost(rtx_insn*) /repo/gcc-trunk/gcc/haifa-sched.c:1421 0x231ff12 dep_cost_1(_dep*, unsigned int) /repo/gcc-trunk/gcc/haifa-sched.c:1474 0x2321bd1 dep_cost(_dep*) /repo/gcc-trunk/gcc/haifa-sched.c:1510 0x2321bd1 priority /repo/gcc-trunk/gcc/haifa-sched.c:1661 0x23224c2 priority /repo/gcc-trunk/gcc/haifa-sched.c:1593 0x23224c2 set_priorities(rtx_insn*, rtx_insn*) /repo/gcc-trunk/gcc/haifa-sched.c:7166 0x13101e2 compute_priorities() /repo/gcc-trunk/gcc/sched-rgn.c:3025 0x1312ef5 schedule_region /repo/gcc-trunk/gcc/sched-rgn.c:3118 0x1312ef5 schedule_insns() /repo/gcc-trunk/gcc/sched-rgn.c:3518 0x13135ab schedule_insns() /repo/gcc-trunk/gcc/sched-rgn.c:3504 0x13135ab rest_of_handle_live_range_shrinkage /repo/gcc-trunk/gcc/sched-rgn.c:3706 0x13135ab execute /repo/gcc-trunk/gcc/sched-rgn.c:3793 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-6219-20220104202718-g0fc60c18335-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r12-6219-20220104202718-g0fc60c18335-checking-yes-rtl-df-extra-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20220105 (experimental) (GCC)