From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04B913858D1E; Mon, 11 Apr 2022 20:28:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04B913858D1E From: "k.even-mendoza at imperial dot ac.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105232] New: ICE in tree_to_poly_int64, at tree.cc:3224 Date: Mon, 11 Apr 2022 20:28:37 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: k.even-mendoza at imperial dot ac.uk 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: Mon, 11 Apr 2022 20:28:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105232 Bug ID: 105232 Summary: ICE in tree_to_poly_int64, at tree.cc:3224 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: k.even-mendoza at imperial dot ac.uk Target Milestone: --- The following code crashed gcc-12 with all flags, and gcc-11 with -O1, -O2,= -O3 and -Os but works fine with -O0. gcc-10 and below works fine. =3D=3D=3D c; #define d(expr, e)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 \ char *f =3D expr;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 \ strlen(f) ?: ++c; struct { char a[0], b[1537228674000000000] } cma[] =3D {{}, {}, {}, {}, {}, {}}; g() { d(cma[4].a, ) } =3D=3D=3D crashed with: /home/user42/data/gcc-csmith-1201/gcc-install/bin/gcc -O2 fuzzer-file-3200.c ... fuzzer-file-3200-1.c:8:7: note: in expansion of macro =E2=80=98d=E2=80=99 8 | g() { d(cma[4].a, ) } | ^ during GIMPLE pass: waccess fuzzer-file-3200-1.c:8:1: internal compiler error: in tree_to_poly_int64, at tree.cc:3224 8 | g() { d(cma[4].a, ) } | ^ 0x7e75cb tree_to_poly_int64(tree_node const*) .././../gcc-source/gcc/tree.cc:3224 0x7e75cb tree_to_poly_int64(tree_node const*) .././../gcc-source/gcc/tree.cc:3222 ... 0xc0ffb8 check_builtin .././../gcc-source/gcc/gimple-ssa-warn-access.cc:3181 0xc0ffb8 check_call .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4280 0xc0ffb8 check_block .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4393 0xc0ffb8 execute .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4742 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D With -O0 it ends without crashing and prints the right error: gcc-11 -O0 fuzzer-file-3200.c ... fuzzer-file-3200.c:8:7: note: in expansion of macro =E2=80=98d=E2=80=99 8 | g() { d(cma[4].a, ) } | ^ fuzzer-file-3200.c: At top level: fuzzer-file-3200.c:7:3: error: size of variable =E2=80=98cma=E2=80=99 is to= o large 7 | } cma[] =3D {{}, {}, {}, {}, {}, {}};=