From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE7AC3861037; Thu, 5 Sep 2024 01:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE7AC3861037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1725500709; bh=LOPYytzZ7A1H6MS3W85l6+YtGYwpUQa2hUbx1w3vTE0=; h=From:To:Subject:Date:From; b=KsmSELkZXgZC8N7QVWnhoU/GyCCJYTHeOcDrohO0TjCYgPUPnNtDpIjvJAmZ0R4nC 7l1MooaejCUDeMF2pLTAUY1zPOTAHT9VgmCra6f/hmr/isw0nBUVszB5nh5B6RDEPB rlc7Ok4PGHVkvRXZVRgF4cOSr3R9KAb9x+vgW20k= From: "iamanonymous.cs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/116607] New: ICE: tree check: expected tree_list, have integer_cst in has_active_contract_condition, at cp/contracts.cc:1505 with no_sanitize attribute and -fcontracts option Date: Thu, 05 Sep 2024 01:45:07 +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: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iamanonymous.cs 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=3D116607 Bug ID: 116607 Summary: ICE: tree check: expected tree_list, have integer_cst in has_active_contract_condition, at cp/contracts.cc:1505 with no_sanitize attribute and -fcontracts option Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com Target Milestone: --- ***************************************************************************= **** OS and Platform: $ uname -a: Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 U= TC 2023 x86_64 x86_64 x86_64 GNU/Linux ***************************************************************************= **** gcc version: Using built-in specs. COLLECT_GCC=3D/home/software/gcc-trunk-3aa004f/bin/gcc COLLECT_LTO_WRAPPER=3D/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-p= c-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --disable-multilib --disable-bootstrap --enable-languages=3Dc,c++ --prefix=3D/home/software/gcc-trunk-3aa004f --enable-coverage Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240630 (experimental) (GCC)=20 ***************************************************************************= **** Program: $ cat mutant.C struct a { __attribute__((no_sanitize(""))) operator+(b) [[pre]] } int a::operator+(int) { This program was reduced by Creduce. ***************************************************************************= **** Command Lines: $ gcc -fcontracts mutant.C mutant.C:2:46: error: 'b' has not been declared 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^ mutant.C:2:54: error: expected contract semantic or level 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^ mutant.C:2:54: error: expected ':' before ']' token 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^ | : mutant.C:2:36: error: ISO C++ forbids declaration of 'operator+' with no ty= pe [-fpermissive] 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^~~~~~~~ mutant.C:2:55: error: expected ';' at end of member declaration 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^ | ; mutant.C:3:2: error: expected ';' after struct definition 3 | } int a::operator+(int) { | ^ | ; mutant.C: In member function 'int a::operator+(int)': mutant.C:2:54: error: expected primary-expression at end of input 2 | __attribute__((no_sanitize(""))) operator+(b) [[pre]] | ^ mutant.C:3:23: internal compiler error: tree check: expected tree_list, have integer_cst in has_active_contract_condition, at cp/contracts.cc:1505 3 | } int a::operator+(int) { | ^ 0x576c1eb diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x576cabd diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x578c98b internal_error(char const*, ...) ???:0 0x2d6b950 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ???:0 0xdca713 tree_check(tree_node*, char const*, int, char const*, tree_code) ???:0 0xf98e83 start_function_contracts(tree_node*) ???:0 0x104a026 start_preparsed_function(tree_node*, tree_node*, int) ???:0 0x104b268 start_function(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) ???:0 0x1378350 c_parse_file() ???:0 0x171c898 c_common_parse_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. Also ICE on trunk. Compiler Explorer: https://godbolt.org/z/WYhhj7q15=