From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E0E33858D37; Tue, 19 Mar 2024 16:49:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E0E33858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710866999; bh=sEydaK41W4IcBAqfPrrKUG2fqk5/fNfQGrV8KY1fsQU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Pa0y4sM1pN2jGV7qx5Xf/sQwYFKLQVokiPRDXqUYI6kEHiJvWJhwu5dpmmT4eNJx7 g576afMtWuRrOKLsTqEsg1bNWqNbPEu5RKPapqxbqhqF2WbbXkKj3pwBW7Hw8wKtHT Dw3rkFYAK7VTP15KV4vdnrI5zsvZMtOY+koYBz3Q= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112499] [11/12/13/14 Regression] ICE in output_operand: invalid expression as operand with addition of 2 differences of address of labels Date: Tue, 19 Mar 2024 16:49:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 --- Comment #4 from Jakub Jelinek --- Or consider typedef unsigned __INTPTR_TYPE__ uintptr_t; volatile int v; int foo (int x) { static uintptr_t a =3D ((char *)&&l2 - (char *)&&l1) + ((char *)&&l4 - (c= har *)&&l3) + ((char *)&&l6 - (char *)&&l5); void *b[] =3D { &&l1, &&l2, &&l3, &&l4, &&l5, &&l6 }; l1: ++v; l2: ++v; l3: ++v; l4: ++v; l5: ++v; l6: ++v; if (x >=3D 0 && x <=3D 5) { x +=3D 42; goto *b[x - 42]; } return a; } That is even older. r0-79351-g7771bb621aad43c7d0e21ccec4922dd3beac9cb6 still used to reject that: error: initializer element is not computable at load time r0-79390-g7ffb5e78794b6d8f8094d7c928e6f0e94b62cad6 already accepts but assembler doesn't handle that: pr112499-2.s:58: Error: invalid operands (*ABS* and .text sections) for `-' pr112499-2.s:58: Error: invalid operands (*ABS* and .text sections) for `-' pr112499-2.s:58: Error: invalid operands (.text and .text sections) for `+' .quad .L3-.L6-.L4-.L2+.L7+.L5 Guess we can only accept a subtraction of 2 labels, not addition of 2 label= s or something more complex.=