From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41AB4385842B; Fri, 24 Feb 2023 05:26:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41AB4385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677216371; bh=+PcupfBVBb0uxW43xPfocFPZrkFzBsj5uQ4R2u9c4EQ=; h=From:To:Subject:Date:From; b=bt/tAxE65L5w3CaWAvdxEmKthhv7HvddHVxPi7jENDh+MaoYaqGE/Y54DaaJM+gUB UNj1ZeaV3Uf4OSVz5iwsvXqzJJ9fAKzQpLQpBsBUMiomehR5KUTaZzmk8hB3psczsm y7lFG2JEhx4B6EcHeQGBsPK2QY/oscs3EEePi8n0= From: "saifi.khan at nishan dot io" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108917] New: ICE when specifying optimization level for C++ contracts code Date: Fri, 24 Feb 2023 05:26:10 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: saifi.khan at nishan dot io 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=3D108917 Bug ID: 108917 Summary: ICE when specifying optimization level for C++ contracts code Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: saifi.khan at nishan dot io Target Milestone: --- Environment - Linux 6.1.0-3-amd64 x86_64 GNU/Linux - Debian GLIBC 2.36-8) 2.36 - gcc version 13.0.1 20230215 (experimental) (GCC) was working through p2680r1 example with the code as follows. --- auto f (int i) -> int { return i + 100; } int g (int j) [[pre: f (j) < j ]] { int r { j - f (j)}; return 2 * r; } auto test () -> void { g (5); } --- :: g++ -std=3Dc++23 -fcontracts contract_01.cc=20 :: ./a.out=20 contract violation in function g at contract_01.cc:8: f (j) < j terminate called without an active exception Aborted ::=20=20 But this doesn't work ! :: g++ -std=3Dc++23 -O3 -g2 -fcontracts contract_01.cc=20 during RTL pass: final contract_01.cc: In function =E2=80=98int g(int)=E2=80=99: contract_01.cc:13:1: internal compiler error: in gen_inlined_subroutine_die= , at dwarf2out.cc:25002 13 | } | ^ 0x7d40a5 gen_inlined_subroutine_die /opt/gcc/src/gcc/dwarf2out.cc:25002 0x7d40a5 gen_block_die /opt/gcc/src/gcc/dwarf2out.cc:26487 0xe3b3ca decls_for_scope /opt/gcc/src/gcc/dwarf2out.cc:26612 0xe18c93 gen_subprogram_die /opt/gcc/src/gcc/dwarf2out.cc:24086 0xe1d82f gen_decl_die /opt/gcc/src/gcc/dwarf2out.cc:27020 0xe1e60a dwarf2out_decl /opt/gcc/src/gcc/dwarf2out.cc:27598 0xe1ea62 dwarf2out_function_decl /opt/gcc/src/gcc/dwarf2out.cc:27613 0xea23e7 rest_of_handle_final /opt/gcc/src/gcc/final.cc:4274 0xea23e7 execute /opt/gcc/src/gcc/final.cc:4318 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report.=