From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A0A5385E83D; Mon, 9 Sep 2024 07:55:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A0A5385E83D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1725868507; bh=4gyEWcvdcHDamwRv7trmYyuUtfPjmGqZA9COwiPS/1w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Q6Vio5bzb0ZZIZyUQ6DV4D6bT+IpSfPJEbm4MpFJ4X1eCWUlklRJt1NwassIspFBx xpWtPJet9Hn1TOiRgOs+HecSt9s4fG9Td9HeV7TU/4J4qPcTPmn0QtsnF3ZGIIL1Dg 6RRhQAoCer7KaAusZ9uZRazWyo9w4gTx2vozrSuM= From: "roger at nextmovesoftware dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/116576] `INT64_MAX` and `-Oz` Date: Mon, 09 Sep 2024 07:55:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: roger at nextmovesoftware dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: bug_status cc everconfirmed cf_reconfirmed_on 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=3D116576 Roger Sayle changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |roger at nextmovesoftware = dot com Ever confirmed|0 |1 Last reconfirmed| |2024-09-09 --- Comment #2 from Roger Sayle --- The constant ~0 can be materialized on x86 in only three bytes using either= of the sequences "push -1; pop rax" (i.e. 6a ff 58) or "stc; sbb ax,ax" (i.e. = f9 19 c0), both of which could theoretically be fused/optimized/avoid dependen= cies on modern hardware. With -Oz, GCC mainline and clang currently use the fir= st sequence. But you're absolutely right that following this by a logical shift can be u= sed to materialize INT64_MAX (and other constants) in fewer bytes than the stan= dard movabs when its safe to clobber the flags.=