From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 7C3BD385E017 for ; Tue, 11 Oct 2022 21:02:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C3BD385E017 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-x429.google.com with SMTP id h13so13208085pfr.7 for ; Tue, 11 Oct 2022 14:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=Ng3bCWbC9JqxIPuDO46GhnDqKUs6d4aedC2WnpPoi5I=; b=wIAQkRG+ymvj/6TXYkOBypafkbjJjbGS3C4t22SC1gayEwzisR9+cGuW+TcON5grAD MqS0ObbvV9ScpnB+BjGhQyn5osRVB6eDXmTfhQ0nTTtQGZDDmKuujEjYit9yZnnbm5Gm 5Z2kcmggS7hLN9rBkn6Yv3v1hHiKHXhEg4niC6I60zkTPKDAP3gkqQ9mieUuLmdmDGwU k53UVaC2U2WtnPoP12KnsWVGoCbRmuANWdmdsvjDbvupAI1aLzD2OWmZS2ip0rG52NP+ ild6F3Cnyw5JFKhcuOjIbaaEj3wMXSloEtUS8999yRIqJxR0tmOmrS9XLY9K6K2kHa3m JXxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ng3bCWbC9JqxIPuDO46GhnDqKUs6d4aedC2WnpPoi5I=; b=22wxoy0tv8yjDB47cjvktrJr2So38M9pzyd2onr6YkD27h4EPYnq2bZrg4mRhRGBdi HzkjSwW15OX0ByAV/4q9UjSClZoD6xHj/5hcU9IiK8u2wyYg5m2ziym0jY/0FbyKKesC BJZpZAN8fQbsiu4rPlzfSUlicGUMELocRkG9QFR5R5C3jN0srnO0p5UGdDg7mGLADqHK foy5JRatXk0ZgG1EsDzWh9iPXvNzHIfzIsgzSwzaOzvUqe9F8H898xd2JC05UpisaD+u 5uzWI0W8LiZn+GWAmKaE8sou7/X+zcvKGArs2VQ1jPmB6lPaHXXySqbD5fK+KoKTFvM0 RSXQ== X-Gm-Message-State: ACrzQf00sbqbyUxEuEwy90zR1XrRBV3dQTQQ4AfJ3MY3QroCZ/ECweOZ Z3vK8xcvESQ72Eba6tXNLH7/7S/9VNmriw== X-Google-Smtp-Source: AMsMyM6rd9nCc6QZejrOwTs0rpbTzVeynvzOV3DdQXnLWp4eXhpUNUvg0BRKfXfWQkFIKV68hduYSw== X-Received: by 2002:a05:6a00:cd1:b0:563:8df5:2b8b with SMTP id b17-20020a056a000cd100b005638df52b8bmr8915277pfv.67.1665522176839; Tue, 11 Oct 2022 14:02:56 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id l12-20020a170903120c00b001785dddc703sm9116936plh.120.2022.10.11.14.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 14:02:56 -0700 (PDT) Date: Tue, 11 Oct 2022 14:02:56 -0700 (PDT) X-Google-Original-Date: Tue, 11 Oct 2022 14:02:46 PDT (-0700) Subject: Re: [PATCH] doc: -falign-functions doesn't override the __attribute__((align(N))) In-Reply-To: CC: gcc-patches@gcc.gnu.org, hubicka@ucw.cz From: Palmer Dabbelt To: richard.guenther@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, 09 Oct 2022 23:07:21 PDT (-0700), richard.guenther@gmail.com wrote: > On Fri, Oct 7, 2022 at 3:50 PM Palmer Dabbelt wrote: >> >> I found this when reading the documentation for Kito's recent patch. >> From the discussion it sounds like this is the desired behavior, so >> let's document it. > > Maybe also mention that the alignment doesn't apply to functions > optimized for size? Oops, I guess that was the whole point of the discussion ;). I sent a v2, which also mentions -Os but not sure we need to do that explicitly. > >> gcc/doc/ChangeLog >> >> * invoke.texi (-falign-functions): Mention __align__ >> --- >> gcc/doc/invoke.texi | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >> index 2a9ea3455f6..8326a60dcf1 100644 >> --- a/gcc/doc/invoke.texi >> +++ b/gcc/doc/invoke.texi >> @@ -13136,7 +13136,9 @@ effective only in combination with @option{-fstrict-aliasing}. >> Align the start of functions to the next power-of-two greater than or >> equal to @var{n}, skipping up to @var{m}-1 bytes. This ensures that at >> least the first @var{m} bytes of the function can be fetched by the CPU >> -without crossing an @var{n}-byte alignment boundary. >> +without crossing an @var{n}-byte alignment boundary. This does not override >> +functions that otherwise specify their own alignment constraints, such as via >> +an alignment attribute. >> >> If @var{m} is not specified, it defaults to @var{n}. >> >> -- >> 2.34.1 >>