From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 634F2385841A; Wed, 20 Mar 2024 15:26:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 634F2385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710948371; bh=x3qTlyaSPbh3EuR/Rdk5HQR4rXlZSzL36SMFMkDV96s=; h=From:To:Subject:Date:From; b=QQ+W9o9cDPI7ZfSpExInW0qqfUWs+6vaz+x66rGU2tzA+VdhgUQaw0gn3ZRVNHkkS rbT0Ltf8rDszsX6+mtqmu8iDNCtjfi3izwliaRhyh+HwUdQTZ6AvbNSfiGw0W+9JmL QPMtHBWgG8j13xYpJGwdSqKFA3Q9xEni9u4Ivyf0= From: "gabravier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/114408] New: Crash when invoking strcmp multiple times with -fsanitize=undefined -O1 -fanalyzer -flto Date: Wed, 20 Mar 2024 15:26:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gabravier at gmail dot com 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=3D114408 Bug ID: 114408 Summary: Crash when invoking strcmp multiple times with -fsanitize=3Dundefined -O1 -fanalyzer -flto Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- int main(){} int HMAP_unset_copy(const char *key) { return __builtin_strcmp("a", key) + __builtin_strcmp("a", key); } Compiling this program with `-fsanitize=3Dundefined -O1 -fanalyzer -flto` r= esults in the following: : In function 'HMAP_unset_copy': :4:41: warning: check of 'key_4(D)' for NULL after already dereferencing it [-Wanalyzer-deref-before-check] 4 | return __builtin_strcmp("a", key) + __builtin_strcmp("a", key); | ^ 'HMAP_unset_copy': events 1-2 | | 4 | return __builtin_strcmp("a", key) + __builtin_strcmp("a", key); | | ^ ~ | | | | | | | (2) pointer 'key_4(D)'= is checked for NULL here but it was already dereferenced at (1) | | (1) pointer 'key_4(D)' is dereferenced here | during IPA pass: whole-program At top level: lto1: internal compiler error: in release_function_body, at cgraph.cc:1813 0x221519c internal_error(char const*, ...) ???:0 0x926a67 fancy_abort(char const*, int, char const*) ???:0 0xa1a687 cgraph_node::release_body(bool) ???:0 0xa1c2d2 cgraph_node::remove() ???:0 0xcea661 symbol_table::remove_unreachable_nodes(_IO_FILE*) ???: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. lto-wrapper: fatal error: /opt/compiler-explorer/gcc-snapshot/bin/gcc retur= ned 1 exit status compilation terminated. /opt/compiler-explorer/gcc-trunk-20240320/bin/../lib/gcc/x86_64-linux-gnu/1= 4.0.1/../../../../x86_64-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Compiler returned: 1=