From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 386323858400; Sat, 27 Nov 2021 08:53:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 386323858400 From: "zsojka at seznam dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103450] New: ICE: SIGSEGV in memory_operand (recog.c:1818) with -Og -fharden-compares -fschedule-insns2 -fno-tree-dce -fno-tree-fre Date: Sat, 27 Nov 2021 08:53:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: zsojka at seznam dot cz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcchost attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Nov 2021 08:53:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103450 Bug ID: 103450 Summary: ICE: SIGSEGV in memory_operand (recog.c:1818) with -Og -fharden-compares -fschedule-insns2 -fno-tree-dce -fno-tree-fre Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Created attachment 51888 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51888&action=3Dedit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -Og -fharden-compares -fschedule-insns2 -fno-tree= -dce -fno-tree-fre testcase.c -wrapper valgrind,-q =3D=3D19667=3D=3D Invalid read of size 2 =3D=3D19667=3D=3D at 0x12AEABC: memory_operand (recog.c:1818) =3D=3D19667=3D=3D by 0x12AEABC: memory_operand(rtx_def*, machine_mode) (recog.c:1805) =3D=3D19667=3D=3D by 0x1AC93A2: get_attr_memory(rtx_insn*) (i386.md:4995) =3D=3D19667=3D=3D by 0x1EC7D58: insn_default_latency_generic(rtx_insn*) (i386.md:18795) =3D=3D19667=3D=3D by 0x22DFFA1: insn_sched_cost (haifa-sched.c:1421) =3D=3D19667=3D=3D by 0x22DFFA1: insn_sched_cost(rtx_insn*) (haifa-sched.= c:1387) =3D=3D19667=3D=3D by 0x22E5031: dep_cost_1(_dep*, unsigned int) (haifa-s= ched.c:1474) =3D=3D19667=3D=3D by 0x22E6D29: dep_cost (haifa-sched.c:1510) =3D=3D19667=3D=3D by 0x22E6D29: priority(rtx_insn*, bool) [clone .part.0] (haifa-sched.c:1661) =3D=3D19667=3D=3D by 0x22E7623: priority (haifa-sched.c:1593) =3D=3D19667=3D=3D by 0x22E7623: set_priorities(rtx_insn*, rtx_insn*) (haifa-sched.c:7166) =3D=3D19667=3D=3D by 0x1304252: compute_priorities() (sched-rgn.c:3025) =3D=3D19667=3D=3D by 0x1307065: schedule_region (sched-rgn.c:3118) =3D=3D19667=3D=3D by 0x1307065: schedule_insns() [clone .part.0] (sched-= rgn.c:3518) =3D=3D19667=3D=3D by 0x13077CD: schedule_insns (sched-rgn.c:3504) =3D=3D19667=3D=3D by 0x13077CD: rest_of_handle_sched2 (sched-rgn.c:3742) =3D=3D19667=3D=3D by 0x13077CD: (anonymous namespace)::pass_sched2::execute(function*) (sched-rgn.c:3878) =3D=3D19667=3D=3D by 0x125F63C: execute_one_pass(opt_pass*) (passes.c:25= 67) =3D=3D19667=3D=3D by 0x125FEAF: execute_pass_list_1(opt_pass*) (passes.c= :2656) =3D=3D19667=3D=3D Address 0xabababababababab is not stack'd, malloc'd or (= recently) free'd =3D=3D19667=3D=3D=20 during RTL pass: sched2 testcase.c: In function 'foo0': testcase.c:29:1: internal compiler error: Segmentation fault 29 | } | ^ 0x1368ecf crash_signal /repo/gcc-trunk/gcc/toplev.c:322 0x12aeabc memory_operand(rtx_def*, machine_mode) /repo/gcc-trunk/gcc/recog.c:1818 0x12aeabc memory_operand(rtx_def*, machine_mode) /repo/gcc-trunk/gcc/recog.c:1805 0x1ac93a2 get_attr_memory(rtx_insn*) /repo/gcc-trunk/gcc/config/i386/i386.md:4995 0x1ec7d58 insn_default_latency_generic(rtx_insn*) /repo/gcc-trunk/gcc/config/i386/i386.md:18795 0x22dffa1 insn_sched_cost(rtx_insn*) /repo/gcc-trunk/gcc/haifa-sched.c:1421 0x22dffa1 insn_sched_cost(rtx_insn*) /repo/gcc-trunk/gcc/haifa-sched.c:1387 0x22e5031 dep_cost_1(_dep*, unsigned int) /repo/gcc-trunk/gcc/haifa-sched.c:1474 0x22e6d29 dep_cost(_dep*) /repo/gcc-trunk/gcc/haifa-sched.c:1510 0x22e6d29 priority /repo/gcc-trunk/gcc/haifa-sched.c:1661 0x22e7623 priority /repo/gcc-trunk/gcc/haifa-sched.c:1593 0x22e7623 set_priorities(rtx_insn*, rtx_insn*) /repo/gcc-trunk/gcc/haifa-sched.c:7166 0x1304252 compute_priorities() /repo/gcc-trunk/gcc/sched-rgn.c:3025 0x1307065 schedule_region /repo/gcc-trunk/gcc/sched-rgn.c:3118 0x1307065 schedule_insns() /repo/gcc-trunk/gcc/sched-rgn.c:3518 0x13077cd schedule_insns() /repo/gcc-trunk/gcc/sched-rgn.c:3504 0x13077cd rest_of_handle_sched2 /repo/gcc-trunk/gcc/sched-rgn.c:3742 0x13077cd execute /repo/gcc-trunk/gcc/sched-rgn.c:3878 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=3D/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-g= cc COLLECT_LTO_WRAPPER=3D/repo/gcc-trunk/binary-trunk-r12-5555-20211127001619-= gf4ed2e3ae7d-checking-yes-rtl-df-extra-nobootstrap-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=3Dc,c++ --enable-valgrind-annotations --disable-nls --enable-checking=3Dyes,rtl,df,= extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=3Dx86_64-pc-linux-gnu --host=3Dx86_64-pc-linux-gnu --target=3Dx86_64-pc-linux-gnu --with-ld=3D/usr/bin/x86_64-pc-linux-gnu-ld --with-as=3D/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=3D/repo/gcc-trunk//binary-trunk-r12-5555-20211127001619-gf4ed2e3ae= 7d-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20211127 (experimental) (GCC)=