From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 76BD0385773C; Tue, 18 Jul 2023 17:48:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76BD0385773C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689702508; bh=vmoL81+hczZRcXoIZ+x4Riq5TOnITshqYS8SbiEW/nM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GW7nd/E0tqNKn5CinOghLc+aopgfbC6wduOuvwcpxJTkSeeaueRbspqyEvXBuDQVW apbOO5KtCxoELBmVxlItKiVSR9FnVp4IZzpdTELCAg1/fvHlmiu/aXver99+U2aEZ0 36BBPkfx1RfbvyR09LaU1a6pJQEtclIySnP+CXjo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110724] Unnecessary alignment on branch to unconditional branch targets Date: Tue, 18 Jul 2023 17:48:28 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: WAITING 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 cf_reconfirmed_on everconfirmed 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=3D110724 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2023-07-18 Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski --- The generic tuning is: "16:11:8", /* Loop alignment. */ "16:11:8", /* Jump alignment. */ "0:0:8", /* Label alignment. */ The the operands are described as: https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Optimize-Options.html#index-f= align-functions ``` -falign-functions=3Dn:m:n2 ... Examples: -falign-functions=3D32 aligns functions to the next 32-byte bound= ary, -falign-functions=3D24 aligns to the next 32-byte boundary only if this can= be done by skipping 23 bytes or less, -falign-functions=3D32:7 aligns to the n= ext 32-byte boundary only if this can be done by skipping 6 bytes or less. The second pair of n2:m2 values allows you to specify a secondary alignment: -falign-functions=3D64:7:32:3 aligns to the next 64-byte boundary if this c= an be done by skipping 6 bytes or less, otherwise aligns to the next 32-byte boun= dary if this can be done by skipping 2 bytes or less. If m2 is not specified, it defaults to n2. ``` So align jumps to 16 byte if 11 or less bytes can be used or 8 byte alignme= nt Which is exactly what this does: .p2align 4,,7 # <-- unnecessary alignment .p2align 3=