From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B3E253858C30; Sun, 9 Jul 2023 11:34:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3E253858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688902475; bh=koVRVcwfzCyqTaFjqyKceKl1PD58biqm+A+cO/S1xBY=; h=From:To:Subject:Date:From; b=pyyvIR06sGpGVxixJeou5OaSBzmVCFFrLR8Fgj30G28ggH4I/JKrKLZSdVQkk7qES fPBexJ+wg/EfQfuyIdO9mQsdmQOLz5rHUryPf6LCpepWWitifLN+h9i6ELBHjDoDJH L4vY4BI9d/s6euRb79qtTM3iY4l7ya9f42V1LD2E= From: "141242068 at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/110603] New: GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104 Date: Sun, 09 Jul 2023 11:34:35 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: 141242068 at smail dot nju.edu.cn 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110603 Bug ID: 110603 Summary: GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: 141242068 at smail dot nju.edu.cn Target Milestone: --- The testing program: ``` typedef long unsigned int size_t; void *memcpy(void *, const void *, size_t); int snprintf(char *restrict, size_t, const char *restrict, ...); extern char a[2]; void test_func_on_line_62(void) { memcpy(a, "12", sizeof("12") - 1); const int res =3D snprintf(0, 0, "%s", a); if (res <=3D 3) do { extern void f(void); f(); } while (0); } ``` When attempting to compile it with `gcc-14 -O2 small.c`, gcc-14 crashes: ``` during GIMPLE pass: strlen : In function 'test_func_on_line_62': :6:6: internal compiler error: in verify_range, at value-range.cc:1= 104 6 | void test_func_on_line_62(void) { | ^~~~~~~~~~~~~~~~~~~~ 0x213b0ee internal_error(char const*, ...) ???:0 0x9ca9f8 fancy_abort(char const*, int, char const*) ???:0 0x13df0f7 irange::set(tree_node*, generic_wide_int const&, generic_wide_int const&, value_range_kind) ???:0 0x1e24a5d handle_printf_call(gimple_stmt_iterator*, pointer_query&) ???:0 0x12d3d86 strlen_pass::check_and_optimize_call(bool*) ???:0 0x12d4109 strlen_pass::check_and_optimize_stmt(bool*) ???:0 0x12d4494 strlen_pass::before_dom_children(basic_block_def*) ???:0 0x1d98997 dom_walker::walk(basic_block_def*) ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. ``` This crash can be verified at https://gcc.godbolt.org/z/439GM47z9=