From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D85A2385840D; Wed, 7 Jun 2023 05:06:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D85A2385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686114399; bh=IsU3TiVw6N6OZNgfd5qo9GtJynMCtov7T2yzUUYBxUI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bB/u6vlJEbr/WA3vvQQuDL2kKkvifors02P+xqpLYzo3hReL5jlBMTsTDCk/l0nWy rnp/3dcXNJS9t2zcgTV62PuVxfes5amcSeFmx39uZamdcGEsuMYfAuKT8M8fyPuNAi NRHG1Nc41tpbnx/65M0fFxnLa/xRYavDGVVdn43w= From: "admin@tho-otto.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/110126] Variables are reported as unused when only referenced by ASM statements Date: Wed, 07 Jun 2023 05:06:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: 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=3D110126 --- Comment #2 from Thorsten Otto --- But even if i rewrite it like that, i still get the warning. I avoided doing anything machine specific in the first example, but if i actually do, and use something like: PROCEDURE test; BEGIN ASM("movl %1,%%eax; addl $1,%%eax; movl %%eax,%0" : "=3Dr"(x) : "0"(x) : "eax"); END test; i still get the warning. BTW, is there a reason why the string in the asm statement can't be concatenated? eg. especially if the statement becomes longer, you would usually want to w= rite it something like ASM("movl %1,%%eax;" + "addl $1,%%eax;" + "movl %%eax,%0" : "=3Dr"(x) : "0"(x) : "eax");=