From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4568D394FC35; Sun, 9 May 2021 19:56:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4568D394FC35 From: "john at thesnappy dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100494] New: Unterminated recursion in gimple-range.cc (x86_64-w64-mingw32) Date: Sun, 09 May 2021 19:56:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: john at thesnappy dot net 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 bug_severity priority component assigned_to reporter target_milestone 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: Sun, 09 May 2021 19:56:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100494 Bug ID: 100494 Summary: Unterminated recursion in gimple-range.cc (x86_64-w64-mingw32) Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: john at thesnappy dot net Target Milestone: --- While using GCC-11.1.0 on x86_64-w64-mingw32 native to build libiberty sha1= .c, gimple-range.cc enters what looks like unending recursion: the stack gets o= ver 600 frames deep. Steps to reproduce: 1. Build GCC-11.1.0 for x86_64-w64-mingw32 with default -O2. 2. Attempt to compile binutils-2.36.1/libiberty/sha1.c with -O2 or higher (= -O1 does not trigger the issue) gdb.exe --args c:/crossdev/gccmaster/host-toolchain-cross4/bin/../libexec/gcc/x86_64-w64-m= ingw32/11.1.0/cc1.exe -quiet -v -I . -I C:/crossdev/src/binutils-git-2_36_1/libiberty/../include -iprefix c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/ -D_REENTRANT -D HAVE_CONFIG_H -D __USE_MINGW_ACCESS -D _GNU_SOURCE C:/crossdev/src/binutils-git-2_36_1/libiberty/sha1.c -quiet -dumpbase sha1.c -dumpbase-ext .c -mtune=3Dgeneric -march=3Dx86-64 -g -O2 -Wextra -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=3Dlocal -Wpedantic -version -o C:\msys64\tmp\cc3zpuNw.s GNU gdb (GDB) 10.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from c:/crossdev/gccmaster/host-toolchain-cross4/bin/../libexec/gcc/x86_64-w64-m= ingw32/11.1.0/cc1.exe... (gdb) b value-range.cc:1683 Breakpoint 1 at 0x1407b4b70: file ../../../../src/gcc-git-11.1.0/gcc/value-range.cc, line 1683. (gdb) r Starting program: c:\crossdev\gccmaster\host-toolchain-cross4\libexec\gcc\x86_64-w64-mingw32\= 11.1.0\cc1.exe -quiet -v -I . -I C:/crossdev/src/binutils-git-2_36_1/libiberty/../include -iprefix c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/ -D_REENTRANT -D HAVE_CONFIG_H -D __USE_MINGW_ACCESS -D _GNU_SOURCE C:/crossdev/src/binutils-git-2_36_1/libiberty/sha1.c -quiet -dumpbase sha1.c -dumpbase-ext .c "-mtune=3Dgeneric" "-march=3Dx86-64" -g -O2 -Wextra -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes "-Wshadow=3Dlocal" -Wpedan= tic -version -o C:\msys64\tmp\cc3zpuNw.s [New Thread 15968.0x5594] [New Thread 15968.0x34f8] [New Thread 15968.0x4304] GNU C17 (GCC) version 11.1.0 (x86_64-w64-mingw32) compiled by GNU C version 10.3.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version none GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 ignoring nonexistent directory "C:/crossdev/prefix-cross2-x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/11= .1.0/include" ignoring nonexistent directory "C:/crossdev/prefix-cross2-x86_64-w64-mingw32/include" ignoring nonexistent directory "/crossdev/prefix-cross2-x86_64-w64-mingw32/include" ignoring nonexistent directory "C:/crossdev/prefix-cross2-x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/11= .1.0/include-fixed" ignoring nonexistent directory "C:/crossdev/prefix-cross2-x86_64-w64-mingw32/x86_64-w64-mingw32/include" #include "..." search starts here: #include <...> search starts here: . C:/crossdev/src/binutils-git-2_36_1/libiberty/../include c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/include c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/../../../../include c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/include-fixed c:\crossdev\gccmaster\host-toolchain-cross4\bin\../lib/gcc/x86_64-w64-mingw= 32/11.1.0/../../../../x86_64-w64-mingw32/include /mingw/include End of search list. GNU C17 (GCC) version 11.1.0 (x86_64-w64-mingw32) compiled by GNU C version 10.3.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version none GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: aa2c29976909033911bae4d4392787e2 Thread 1 hit Breakpoint 1, irange::irange_intersect (this=3D0x5fe500, r=3D.= ..) at ../../../../src/gcc-git-11.1.0/gcc/value-range.cc:1683 1683 { (gdb) c 179 Will ignore next 178 crossings of breakpoint 1. Continuing. Thread 1 hit Breakpoint 1, irange::irange_intersect (this=3D0x418360, r=3D.= ..) at ../../../../src/gcc-git-11.1.0/gcc/value-range.cc:1683 1683 { (gdb) bt #0 ___chkstk_ms () at ../../../../../src/gcc-git-10.3.0/libgcc/config/i386/cygwin.S:117 #1 0x00000001407b4b86 in irange::irange_intersect (this=3D0x40ea30, r=3D..= .) at ../../../../src/gcc-git-11.1.0/gcc/value-range.cc:1683 #2 0x0000000140de72d2 in irange::intersect (r=3D..., this=3D0x40ea30) at ../../../../src/gcc-git-11.1.0/gcc/value-range.h:546 #3 gimple_ranger::range_of_stmt (this=3D0x29769a0, r=3D..., s=3D, name=3D0x2ac1b88) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1073 #4 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29769a0, r= =3D..., expr=3D0x2ac1b88, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #5 0x0000000140de4681 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29769a0, r=3D..., s=3Ds@entry=3D0x2ac4000) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:438 #6 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x2= 9769a0, r=3D..., s=3Ds@entry=3D0x2ac4000, name=3Dname@entry=3D0x2ac1c60) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #7 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29769a0, r= =3D..., s=3D0x2ac4000, name=3D0x2ac1c60) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #8 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29769a0, r= =3D..., expr=3D0x2ac1c60, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #9 0x0000000140de4681 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29769a0, r=3D..., s=3Ds@entry=3D0x2ac40b0) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:438 #10 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x2= 9769a0, r=3D..., s=3Ds@entry=3D0x2ac40b0, name=3Dname@entry=3D0x2ac1d38) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #11 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29769a0, r= =3D..., s=3D0x2ac40b0, name=3D0x2ac1d38) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #12 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29769a0, r= =3D..., expr=3D0x2ac1d38, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #13 0x0000000140de4681 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29769a0, r=3D..., s=3Ds@entry=3D0x2ac4108) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:438 #14 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x2= 9769a0, r=3D..., s=3Ds@entry=3D0x2ac4108, name=3Dname@entry=3D0x2b29678) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 --Type for more, q to quit, c to continue without paging-- #15 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29769a0, r= =3D..., s=3D0x2ac4108, name=3D0x2b29678) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #16 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29769a0, r= =3D..., expr=3D0x2b29678, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #17 0x0000000140de46a9 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29769a0, r=3D..., s=3Ds@entry=3D0x2ac4160) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:443 #18 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x2= 9769a0, r=3D..., s=3Ds@entry=3D0x2ac4160, name=3Dname@entry=3D0x2b296c0) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #19 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29769a0, r= =3D..., s=3D0x2ac4160, name=3D0x2b296c0) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #20 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29769a0, r= =3D..., expr=3D0x2b296c0, stmt=3D) ... #599 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29c1a70, = r=3D..., expr=3D0x2a53288, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #600 0x0000000140de4681 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29c1a70, r=3D..., s=3Ds@entry=3D0x2a50f78) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:438 #601 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x= 29c1a70, r=3D..., s=3Ds@entry=3D0x2a50f78, name=3Dname@entry=3D0x2a8edc8) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #602 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29c1a70, = r=3D..., s=3D0x2a50f78, name=3D0x2a8edc8) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #603 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29c1a70, = r=3D..., expr=3D0x2a8edc8, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #604 0x0000000140de46a9 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29c1a70, r=3D..., s=3Ds@entry=3D0x2a54000) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:443 #605 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x= 29c1a70, r=3D..., s=3Ds@entry=3D0x2a54000, name=3Dname@entry=3D0x2a8ee10) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #606 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29c1a70, = r=3D..., s=3D0x2a54000, name=3D0x2a8ee10) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #607 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29c1a70, = r=3D..., expr=3D0x2a8ee10, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #608 0x0000000140de46a9 in gimple_ranger::range_of_range_op (this=3Dthis@entry=3D0x29c1a70, r=3D..., s=3Ds@entry=3D0x2a540b0) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:443 #609 0x0000000140de6c77 in gimple_ranger::calc_stmt (this=3Dthis@entry=3D0x= 29c1a70, r=3D..., s=3Ds@entry=3D0x2a540b0, name=3Dname@entry=3D0x2a53318) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:374 #610 0x0000000140de72b5 in gimple_ranger::range_of_stmt (this=3D0x29c1a70, = r=3D..., s=3D0x2a540b0, name=3D0x2a53318) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1068 #611 0x0000000140de30a9 in gimple_ranger::range_of_expr (this=3D0x29c1a70, = r=3D..., expr=3D0x2a53318, stmt=3D) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:960 #612 0x0000000140de21ea in gimple_ranger::range_on_edge (this=3D0x29c1a70, = r=3D..., e=3D0x2a56120, name=3D0x2a53318) at ../../../../src/gcc-git-11.1.0/gcc/gimple-range.cc:1030 #613 0x00000001407ad28f in range_query::value_on_edge (this=3D0x29c1a70, e=3D, name=3D0x2a53318) at ../../../../src/gcc-git-11.1.0/gcc/value-query.cc:106 #614 0x0000000140df0cca in hybrid_folder::value_on_edge (this=3D0x5ff800, e=3D0x2a56120, op=3D0x2a53318) at ../../../../src/gcc-git-11.1.0/gcc/gimple-ssa-evrp.c:245 #615 0x000000014068c39b in substitute_and_fold_engine::replace_phi_args_in (this=3D0x5ff800, phi=3Dphi@entry=3D0x295be00) at ../../../../src/gcc-git-11.1.0/gcc/tree-ssa-propagate.c:913 #616 0x000000014068c64d in substitute_and_fold_dom_walker::before_dom_child= ren (this=3D0x5ff750, bb=3D0x2a089a0) at ../../../../src/gcc-git-11.1.0/gcc/tree-ssa-propagate.c:1087 #617 0x0000000140dbe846 in dom_walker::walk (this=3D0x5ff750, bb=3D0x2a089a= 0) at ../../../../src/gcc-git-11.1.0/gcc/domwalk.c:309 #618 0x000000014068bd58 in substitute_and_fold_engine::substitute_and_fold (this=3D, block=3Dblock@entry=3D0x0) at ../../../../src/gcc-git-11.1.0/gcc/tree-ssa-propagate.c:1283 #619 0x0000000140df090d in execute_early_vrp () at ../../../../src/gcc-git-11.1.0/gcc/gimple-ssa-evrp.c:349 #620 0x00000001404705e5 in execute_one_pass (pass=3Dpass@entry=3D0x2500630)= at ../../../../src/gcc-git-11.1.0/gcc/passes.c:2567 #621 0x0000000140470f78 in execute_pass_list_1 (pass=3D0x2500630) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:2656 #622 0x0000000140470f8a in execute_pass_list_1 (pass=3D0x2500120) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:2657 #623 0x0000000140470fc1 in execute_pass_list (fn=3D0x28ba0c0, pass=3D) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:2667 #624 0x000000014046dca3 in do_per_function_toporder (callback=3Dcallback@entry=3D0x140470fa0 , data=3D0x24ffee0) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:1773 #625 0x0000000140471540 in do_per_function_toporder (data=3D, callback=3D0x140470fa0 ) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:1741 #626 execute_ipa_pass_list (pass=3D0x24ffe50) at ../../../../src/gcc-git-11.1.0/gcc/passes.c:3001 #627 0x00000001401771b0 in ipa_passes () at ../../../../src/gcc-git-11.1.0/gcc/cgraphunit.c:2156 #628 symbol_table::compile (this=3Dthis@entry=3D0x24db000) at ../../../../src/gcc-git-11.1.0/gcc/cgraphunit.c:2291 #629 0x0000000140179834 in symbol_table::compile (this=3D0x24db000) at ../../../../src/gcc-git-11.1.0/gcc/cgraphunit.c:2271 #630 symbol_table::finalize_compilation_unit (this=3D0x24db000) at ../../../../src/gcc-git-11.1.0/gcc/cgraphunit.c:2539 #631 0x000000014053336c in compile_file () at ../../../../src/gcc-git-11.1.0/gcc/toplev.c:482 #632 0x00000001411192f3 in do_compile () at ../../../../src/gcc-git-11.1.0/gcc/toplev.c:2201 #633 toplev::main (this=3Dthis@entry=3D0x5ffe0e, argc=3D, argc@entry=3D36, argv=3D, argv@entry=3D0x161910) at ../../../../src/gcc-git-11.1.0/gcc/toplev.c:2340 #634 0x0000000141144677 in main (argc=3D36, argv=3D0x161910) at ../../../../src/gcc-git-11.1.0/gcc/main.c:39 Eventually __chkstk_ms encounters a segfault. Thread 1 received signal SIGSEGV, Segmentation fault. ___chkstk_ms () at ../../../../../src/gcc-git-10.3.0/libgcc/config/i386/cygwin.S:126 126 ../../../../../src/gcc-git-10.3.0/libgcc/config/i386/cygwin.S: No s= uch file or directory. (gdb) bt #0 ___chkstk_ms () at ../../../../../src/gcc-git-10.3.0/libgcc/config/i386/cygwin.S:126 #1 0x0000000000001040 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?)=