From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EEA63385C6DD; Mon, 5 Jun 2023 12:45:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEA63385C6DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685969123; bh=RH2cPHfsaN9Efp36efahRqwswz9G62a7UAvQ+fXD2uc=; h=From:To:Subject:Date:From; b=ib3rhyYTV9irMHw9eayywFPaC0NmQ/4Q1cTzBD6Ts37mAnpOGeouy/5cTZ8KpyiiX r+ft4/aMNtKN36WAItuFLxRtnybMtl2VPRg6K0abSx2yU2ALhG9Nkx7q3m3tmyuq+1 R1hEpjZZV5ZXHP7b/B5eLC/uRd7Pej23e9+pdwGI= From: "admin@tho-otto.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/110126] New: Variables are reported as unused when only referenced by ASM statements Date: Mon, 05 Jun 2023 12:45:23 +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=3D110126 Bug ID: 110126 Summary: Variables are reported as unused when only referenced by ASM statements 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: --- In the following fragment: MODULE foo; VAR x: INTEGER; PROCEDURE test; BEGIN ASM("" : : "m"(x)); END test; END foo. x is reported as unused (same happens when specifying it as output paramete= r) Even worse, when used as input operand only, the whole asm statement seems = to be optimized away.=