From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACE8D3858404; Mon, 13 Nov 2023 02:28:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACE8D3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699842515; bh=B5W0PL9eCK63V7upk6guutuFSyKfJNQlOfaQ26l0c6A=; h=From:To:Subject:Date:From; b=NuWJ6X4RnujzlEA9vq6njk1s9L+fVhiIwlGNX4LEWshev+KCaNS3MHD/G+7WBC5vu 42epgsqh3hrUo/hZ0VqM7OCI13xdN2xup0xl7jKLkiFp4GtiFhUtJ5WfSlV6rnCY/D 24AfguZlWaUOa7w79BD9LI9XR0UXNvi/0EVPnMlM= From: "141242068 at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112499] New: GCC: 14: internal compiler error: output_operand: invalid expression as operand Date: Mon, 13 Nov 2023 02:28: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=3D112499 Bug ID: 112499 Summary: GCC: 14: internal compiler error: output_operand: invalid expression as operand 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: --- Compiler Explorer: https://gcc.godbolt.org/z/MdacfWqhr When attempting to compile this program with `gcc-14 -O1`, gcc crashes: ``` #include int f(void) { static uintptr_t a =3D ((char *)&&l3 - (char *)&&l2) + ((char *)&&l1 - (char *)&&l2); l1: l2: l3: return a; } ``` If removing the qualifier `static`, then this crash disappears. The crash output: ``` :10:1: internal compiler error: output_operand: invalid expression = as operand 10 | } | ^ 0x238b15e internal_error(char const*, ...) ???:0 0xd01147 output_operand_lossage(char const*, ...) ???:0 0xd01c71 output_addr_const(_IO_FILE*, rtx_def*) ???:0 0xd01a53 output_addr_const(_IO_FILE*, rtx_def*) ???:0 0xd01ae5 output_addr_const(_IO_FILE*, rtx_def*) ???:0 0x14cec92 assemble_integer_with_op(char const*, rtx_def*) ???:0 0x14cecf1 default_assemble_integer(rtx_def*, unsigned int, int) ???:0 0x14ced7f assemble_integer(rtx_def*, unsigned int, unsigned int, int) ???:0 0x14e1cae assemble_variable(tree_node*, int, int, int) ???:0 0x14e62ae symbol_table::output_variables() ???:0 0xc027bb symbol_table::finalize_compilation_unit() ???: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. Compiler returned: 1 ```=