From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B969C3857357; Thu, 8 Jun 2023 14:18:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B969C3857357 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686233929; bh=0dIKCud3rdi1qpb/TCtiaf75VugfyKqOk107T3tGHlc=; h=From:To:Subject:Date:From; b=sG0MraBMtdNkSo0/iHD8Xvaea6Xq/lXgwd+7qJvVjvA9tyGuyCgQl5x0ywnK7U1ii qxh826e4mR3SEVMMEAGKupR9dAu5QkH2iQWvaBccOJAYb9xQR5cQ8NbpOI9wcrzqRp keZxRfImoJlvtk872UNej5uWBJA66QRMS/xMBhEI= From: "admin@tho-otto.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/110174] New: Using illegal constraints for builtin return_address gives ICE Date: Thu, 08 Jun 2023 14:18:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: admin@tho-otto.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius 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=3D110174 Bug ID: 110174 Summary: Using illegal constraints for builtin return_address gives ICE Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: admin@tho-otto.de Target Milestone: --- When compiling the the following module with -O2 MODULE foo; FROM Builtins IMPORT return_address; FROM SYSTEM IMPORT ADDRESS; VAR x: ADDRESS; PROCEDURE test(); BEGIN ASM VOLATILE("" : "=3Dm"(x) : "m"(return_address(0)) : ); END test; BEGIN test(); END foo. I get an ICE: during RTL pass: expand In function =E2=80=98test=E2=80=99, inlined from =E2=80=98_M2_foo_init=E2=80=99 at foo.mod:13:3: foo.mod:9:56: internal compiler error: in expand_asm_stmt, at cfgexpand.cc:= 3419 9 | ASM VOLATILE("" : "=3Dm"(x) : "m"(return_address(0)) : ); | ^ The ICE is triggered at https://github.com/gcc-mirror/gcc/blob/9589a46ddadc8b93c224c3f84fa94746c045= 96bf/gcc/cfgexpand.cc#L3419 Using "m" as constraint is actually wrong, however the C backend handles th= at correctly: foo.c:5:39: error: memory input 1 is not directly addressable 5 | __asm__ volatile("" : "=3Dm"(x) : "m"(__builtin_return_address(0)= ) : );=