From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 500133858027; Tue, 22 Feb 2022 18:38:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 500133858027 From: "zsojka at seznam dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/104644] New: [12 Regression] ICE: SIGSEGV (infinite recursion in fold_binary_loc / fold_build2_loc / generic_simplify_NE_EXPR) Date: Tue, 22 Feb 2022 18:38:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c 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 cf_gcctarget 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: Tue, 22 Feb 2022 18:38:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104644 Bug ID: 104644 Summary: [12 Regression] ICE: SIGSEGV (infinite recursion in fold_binary_loc / fold_build2_loc / generic_simplify_NE_EXPR) Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 52493 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D52493&action=3Dedit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc testcase.c -wrapper valgrind,-q testcase.c: In function 'foo': testcase.c:4:29: warning: overflow in conversion from 'float' to 'short unsigned int' changes value from '1.31072e+5f' to '65535' [-Woverflow] 4 | return __builtin_bswap16 ((float) 0x20000) !=3D (char) (float) 0x= 20000; | ^~~~~~~~~~~~~~~ =3D=3D21462=3D=3D Stack overflow in thread #1: can't grow stack to 0x1ffe00= 1000 =3D=3D21462=3D=3D Can't extend stack to 0x1ffe000e48 during signal delivery= for thread 1: =3D=3D21462=3D=3D no stack segment =3D=3D21462=3D=3D=20 =3D=3D21462=3D=3D Process terminating with default action of signal 11 (SIG= SEGV) =3D=3D21462=3D=3D Access not within mapped region at address 0x1FFE000E48 =3D=3D21462=3D=3D Stack overflow in thread #1: can't grow stack to 0x1ffe00= 1000 =3D=3D21462=3D=3D at 0xE22224: ggc_internal_alloc(unsigned long, void (*= )(void*), unsigned long, unsigned long) (ggc-page.cc:1278) =3D=3D21462=3D=3D If you believe this happened as a result of a stack =3D=3D21462=3D=3D overflow in your program's main thread (unlikely but =3D=3D21462=3D=3D possible), you can try to increase the size of the =3D=3D21462=3D=3D main thread stack using the --main-stacksize=3D flag. =3D=3D21462=3D=3D The main thread stack size used in this run was 16777216. x86_64-pc-linux-gnu-gcc: internal compiler error: Segmentation fault signal terminated program valgrind Please submit a full bug report, with preprocessed source (by using -freport-bug). See for instructions. (gdb) bt #0 generic_simplify_113 (loc=3D2147483649, type=3D0x7ffff76c35e8, captures=3D0x7ffffbfff090, cmp=3DNE_EXPR, bswap=3DCFN_BUILT_IN_BSWAP16,=20 _p1=3D, _p0=3D) at generic-match.cc:6558 #1 0x0000000001afd8db in generic_simplify_NE_EXPR (loc=3D2147483649, type=3D0x7ffff76c35e8, _p0=3D0x7ffff70c7620, _p1=3D0x7ffff77f2510,=20 code=3DNE_EXPR) at generic-match.cc:61429 #2 0x0000000000fe500f in fold_binary_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff70c7620, op1=3D0x7ffff77f2510) at /repo/gcc-trunk/gcc/fold-const.cc:10862 #3 0x0000000000fedb6a in fold_build2_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff70c7620, op1=3D0x7ffff77f2510) at /repo/gcc-trunk/gcc/fold-const.cc:13814 #4 0x0000000000fedb6a in fold_build2_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff77f2510, op1=3D0x7ffff70c7620) at /repo/gcc-trunk/gcc/fold-const.cc:13814 #5 0x0000000001afd8db in generic_simplify_NE_EXPR (loc=3D2147483649, type=3D0x7ffff76c35e8, _p0=3D0x7ffff70c75e8, _p1=3D0x7ffff77f24f8,=20 code=3DNE_EXPR) at generic-match.cc:61429 #6 0x0000000000fe500f in fold_binary_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff70c75e8, op1=3D0x7ffff77f24f8) at /repo/gcc-trunk/gcc/fold-const.cc:10862 #7 0x0000000000fedb6a in fold_build2_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff70c75e8, op1=3D0x7ffff77f24f8) at /repo/gcc-trunk/gcc/fold-const.cc:13814 #8 0x0000000000fedb6a in fold_build2_loc (loc=3D2147483649, code=3DNE_EXPR, type=3D0x7ffff76c35e8, op0=3D0x7ffff77f24f8, op1=3D0x7ffff70c75e8) at /repo/gcc-trunk/gcc/fold-const.cc:13814 #9 0x0000000001afd8db in generic_simplify_NE_EXPR (loc=3D2147483649, type=3D0x7ffff76c35e8, _p0=3D0x7ffff70c75b0, _p1=3D0x7ffff77f2510,=20 code=3DNE_EXPR) at generic-match.cc:61429 ... $ 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-7349-20220222175310-= g54f74502327-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc= /x86_64-pc-linux-gnu/12.0.1/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-7349-20220222175310-g54f745023= 27-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.1 20220222 (experimental) (GCC)=