From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD3FE38582A3; Tue, 7 Mar 2023 17:32:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD3FE38582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678210373; bh=D9ui6kX0XL4256GZ76zy9ic9eJJgxXWLv03+1I83e/0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=peChQwM+k8knjzTTlnAn3UIGNYmNGvDb/gXOwIKiwvZq6kKDOqlHYZ4p0CmQSyuYq fRG6RBmReyzHX3sbJKLDR/m3L3DBTdv3ENsno/bsMtGuVOQh//OQb5do+peBY7UJTs OYZdr9zJ9KXgOsu7LycFwMyd02SGBdUrLMcs07Yw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109057] Does GCC interpret assembly when deciding to optimize away a variable? Date: Tue, 07 Mar 2023 17:32:53 +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: unknown X-Bugzilla-Keywords: inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: 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=3D109057 --- Comment #8 from Andrew Pinski --- (In reply to Jakub Jelinek from comment #5) > (In reply to Andrew Pinski from comment #2) > > No it is not. you just don't notice it there because goldbolt is hiding > > things because it thinks it is unused. >=20 > This actually isn't godbolt hiding anything (which it does sometimes), but > because > nothing is printed in the asm nothing needs to be printed into the assemb= ly > output. > It still acts as a black box to the compiler. Kinda. >More importantly, the entire static array LUT was optimized away from the = object file.=20 the asm code still has LUT array (godbolt does hide unused lables by defaul= t). Using the original code we do get: .type LUT, @object .size LUT, 8 LUT: .string "\001\005\003" .ascii "\002\007\001\002"=