From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F9FB38388E3; Thu, 15 Dec 2022 20:30:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F9FB38388E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671136233; bh=KTX5+u7ZuDmj0xXtx3Jz7QKMzPbwPTIZxjYzNLGscfA=; h=From:To:Subject:Date:From; b=ryeC+U+++3r3BFhoT5xx9yu8SOBjWzAqljdTlFquvE07xKLf1TIBybTCdE4+IfH2U GQtEnhweOgs+X3TM7HLGzJTFQZpY/ej7ZN9l8xRxH3piZnH7b0TGR1AkA/cdhFJ1z7 Ku+a56VsVseTM4n9txxr1vqB2rKFOt0VPugWVz9Q= From: "ucko at ncbi dot nlm.nih.gov" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108137] New: [12 Regression] ICE: segfault during GIMPLE pass: warn-printf Date: Thu, 15 Dec 2022 20:30:33 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ucko at ncbi dot nlm.nih.gov 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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108137 Bug ID: 108137 Summary: [12 Regression] ICE: segfault during GIMPLE pass: warn-printf Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ucko at ncbi dot nlm.nih.gov Target Milestone: --- Created attachment 54105 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54105&action=3Dedit -freport-bug output I encountered a GCC crash with the below backtrace when compiling with -Wall code I was able to reduce to #include void f(unsigned short x_port, unsigned int x_host) { printf("missing %s", x_port ? "host" : &"host:port"[x_host ? 5 : 0]); } (full -freport-bug output attached). Could someone please take a look? Thanks! ------------------------------------------------------ during GIMPLE pass: warn-printf /home/ucko/tmp/ncbi_socket.c: In function 'f': /home/ucko/tmp/ncbi_socket.c:6:1: internal compiler error: Segmentation fau= lt 6 | } | ^ 0x19c32b4 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, = char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x19c3f06 internal_error(char const*, ...) ???:0 0xc4624f crash_signal(int) ???:0 0xf0fde2 wi::lts_p_large(long const*, unsigned int, unsigned int, long cons= t*, unsigned int) ???:0 0xdf7a69 get_range_strlen_dynamic(tree_node*, gimple*, c_strlen_data*, bitmap_head*, pointer_query*, unsigned int*) ???:0 0xdf8333 get_range_strlen_dynamic(tree_node*, gimple*, c_strlen_data*, pointer_query&) ???:0 0x18483a6 (anonymous namespace)::format_string((anonymous namespace)::direc= tive const&, tree_node*, pointer_query&) ???:0 0x184584e handle_printf_call(gimple_stmt_iterator*, pointer_query&) ???:0 0xdffb45 strlen_pass::check_and_optimize_call(bool*) ???:0 0xe00491 strlen_pass::check_and_optimize_stmt(bool*) ???:0 0xe00874 strlen_pass::before_dom_children(basic_block_def*) ???:0 0x17e6bae dom_walker::walk(basic_block_def*) ???:0 0xe00bbc (anonymous namespace)::printf_strlen_execute(function*, bool) ???:0=