From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BB483858C60; Sun, 14 Nov 2021 15:55:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BB483858C60 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103231] [12 Regression] ICE (nondeterministic) on valid code at -O1 on x86_64-linux-gnu: Segmentation fault since r12-5014-g6b8b959675a3e14c Date: Sun, 14 Nov 2021 15:55:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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: Sun, 14 Nov 2021 15:55:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103231 --- Comment #11 from Martin Li=C5=A1ka --- But yes, with ulimit -s 512, one can reduce it to: $ cat pr103231.c long g_1496_BK8K8el_2738; int fn1_l_1522; int fn1_l_2664; long fn1_l_1761; unsigned int fn1_l_1812; int fn1_l_2189; int fn1_by; int fn1_l_2688; short fn1_l_1852; short fn1_l_2352; void fn1() { unsigned l_2456; LABEL_5959g: __builtin_printf("l_2456=3D%llu\n", l_2456); LABEL_TaTak: if (fn1_by) if (fn1_l_2189) goto LABEL_5959g; int BK8K8hl_2189 =3D fn1_l_2352 * (~fn1_l_1852 & g_1496_BK8K8el_2738); short dg =3D l_2456 & fn1_l_1761; l_2456 =3D dg; if (fn1_l_1522) fn1_l_1761 =3D ~BK8K8hl_2189; short Bm9m9El_1852 =3D ~(~0 && fn1_l_2688); unsigned Bm9m9Fl_1522 =3D -Bm9m9El_1852; if (fn1_l_1812) fn1_l_1852 =3D ~fn1_l_2664 ^ Bm9m9Fl_1522; goto LABEL_TaTak; } with the following back-trace: #0 0x0000000001218987 in range_query::get_tree_range (this=3D0x7fffffffd4a= 0, r=3D..., expr=3D0x7ffff76200d8, stmt=3D) at /home/marxin/Programming/gcc/gcc/value-query.cc:213 #1 0x0000000001bcb812 in fold_using_range::range_of_range_op (this=3D0x7ffffff8396f, r=3D..., s=3D0x7ffff776c108, src=3D...) at /home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:617 #2 0x0000000001bcce12 in fold_using_range::fold_stmt (this=3D0x7ffffff8396= f, r=3D..., s=3D0x7ffff776c108, src=3D..., name=3D0x7ffff776b360) at /home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:552 #3 0x0000000001bc14a7 in gimple_ranger::fold_range_internal (this=3Dthis@entry=3D0x7fffffffd4a0, r=3D..., s=3Ds@entry=3D0x7ffff776c108, name=3Dname@entry=3D0x7ffff776b360) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:243 #4 0x0000000001bc1757 in gimple_ranger::range_of_stmt (this=3D0x7fffffffd4= a0, r=3D..., s=3D0x7ffff776c108, name=3D0x7ffff776b360) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:296 #5 0x0000000001bc1dc0 in gimple_ranger::range_of_expr (this=3D0x7fffffffd4= a0, r=3D..., expr=3D0x7ffff776b360, stmt=3D) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:113 #6 0x0000000001bcb7e0 in fold_using_range::range_of_range_op (this=3D0x7ffffff87c4f, r=3D..., s=3D0x7ffff776d140, src=3D...) at /home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:600 #7 0x0000000001bcce12 in fold_using_range::fold_stmt (this=3D0x7ffffff87c4= f, r=3D..., s=3D0x7ffff776d140, src=3D..., name=3D0x7ffff776b3a8) at /home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:552 #8 0x0000000001bc14a7 in gimple_ranger::fold_range_internal (this=3Dthis@entry=3D0x7fffffffd4a0, r=3D..., s=3Ds@entry=3D0x7ffff776d140, name=3Dname@entry=3D0x7ffff776b3a8) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:243 ... #164 0x0000000001bc1757 in gimple_ranger::range_of_stmt (this=3D0x7fffffffd= 4a0, r=3D..., s=3D0x7ffff773f500, name=3D0x7ffff776b708) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:296 #165 0x0000000001bc1dc0 in gimple_ranger::range_of_expr (this=3D0x7fffffffd= 4a0, r=3D..., expr=3D0x7ffff776b708, stmt=3D) at /home/marxin/Programming/gcc/gcc/gimple-range.cc:113 #166 0x0000000001bfec29 in (anonymous namespace)::format_integer (dir=3D..., arg=3D0x7ffff776b708, query=3D0x7fffffffd4a0) at /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:1386 #167 0x0000000001bf8de4 in (anonymous namespace)::format_directive (info=3D= ..., res=3D0x7fffffffcf80, dir=3D..., query=3D) at /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:3091 #168 0x0000000001bfc092 in (anonymous namespace)::compute_format_length (query=3D0x7fffffffd4a0, res=3D0x7fffffffcf80, info=3D...) at /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:4033 #169 handle_printf_call (gsi=3Dgsi@entry=3D0x7fffffffd880, ptr_qry=3D...) at /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:4703 #170 0x000000000112a8de in strlen_pass::check_and_optimize_call (this=3D0x7fffffffd480, zero_write=3D0x7fffffffd28f) at /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5379 #171 0x000000000112b592 in strlen_pass::check_and_optimize_stmt (this=3D0x7fffffffd480, cleanup_eh=3D) at /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5583 #172 0x000000000112b9d6 in strlen_pass::before_dom_children (this=3D0x7fffffffd480, bb=3D0x7ffff760d270) at /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5767 #173 0x0000000001b8de48 in dom_walker::walk (this=3D0x7fffffffd480, bb=3D0x7ffff760d270) at /home/marxin/Programming/gcc/gcc/domwalk.c:309 #174 0x000000000112befb in (anonymous namespace)::printf_strlen_execute (fun=3D0x7ffff7764000, warn_only=3D) at /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5831 #175 0x0000000000e2effa in execute_one_pass (pass=3D0x2a1a250) at /home/marxin/Programming/gcc/gcc/passes.c:2567 #176 0x0000000000e2f8f3 in execute_pass_list_1 (pass=3D0x2a1a250) at /home/marxin/Programming/gcc/gcc/passes.c:2656 #177 0x0000000000e2f905 in execute_pass_list_1 (pass=3D0x2a17cc0) at /home/marxin/Programming/gcc/gcc/passes.c:2657 #178 0x0000000000e2f936 in execute_pass_list (fn=3D0x7ffff7764000, pass=3D) at /home/marxin/Programming/gcc/gcc/passes.c:2667 #179 0x0000000000a73975 in cgraph_node::expand (this=3D0x7ffff7616220) at /home/marxin/Programming/gcc/gcc/context.h:48 #180 cgraph_node::expand (this=3D0x7ffff7616220) at /home/marxin/Programming/gcc/gcc/cgraphunit.c:1781 #181 0x0000000000a74fef in expand_all_functions () at /home/marxin/Programming/gcc/gcc/cgraphunit.c:1992 #182 symbol_table::compile (this=3D0x7ffff7605000) at /home/marxin/Programming/gcc/gcc/cgraphunit.c:2356 #183 symbol_table::compile (this=3D0x7ffff7605000) at /home/marxin/Programming/gcc/gcc/cgraphunit.c:2267 #184 0x0000000000a77c58 in symbol_table::finalize_compilation_unit (this=3D0x7ffff7605000) at /home/marxin/Programming/gcc/gcc/cgraphunit.c:25= 37 #185 0x0000000000f1e662 in compile_file () at /home/marxin/Programming/gcc/gcc/toplev.c:479 #186 0x00000000008b969b in do_compile (no_backend=3Dfalse) at /home/marxin/Programming/gcc/gcc/toplev.c:2156 #187 toplev::main (this=3Dthis@entry=3D0x7fffffffdb9e, argc=3D, argc@entry=3D14, argv=3D, argv@entry=3D0x7fffffffdce8) at /home/marxin/Programming/gcc/gcc/toplev.c:2308 #188 0x00000000008bb615 in main (argc=3D14, argv=3D0x7fffffffdce8) at /home/marxin/Programming/gcc/gcc/main.c:39=