public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Rimvydas Jasinskas <rimvydasjas@gmail.com>
Cc: Rimvydas Jasinskas via Fortran <fortran@gcc.gnu.org>
Subject: Re: Support for NOINLINE attribute
Date: Fri, 10 Feb 2023 10:53:10 -0800	[thread overview]
Message-ID: <Y+aSlsgPmcyVqkB8@troutmask.apl.washington.edu> (raw)
In-Reply-To: <CAFmAMQ09jLG_jFwNy+0SLhLd5gCWys0M8Jm+2bZGt0418KQBGg@mail.gmail.com>

On Fri, Feb 10, 2023 at 10:38:04AM +0200, Rimvydas Jasinskas wrote:
> On Fri, Feb 10, 2023 at 10:24 AM Steve Kargl via Fortran
> <fortran@gcc.gnu.org> wrote:
> > > would it be possible to extend gfortran attribute support to handle
> > > NOINLINE too? Like: "!GCC$ ATTRIBUTES noinline :: ...".
> >
> > It looks to me like you are conflating three independent topics.
> > What does NOINLINE have to do with WEAK?  What does WEAK have
> > to do with NORETURN?
> 
> As I wrote these are optional (different issues, quite useful to have
> but still easy to work around with different means), the main issue is
> still missing NOINLINE for -flto.

Unfortunately, conflating unrelated topics can lead to distraction.
I do however see value in NORETURN.  I suppose a person writing a
library may find WEAK useful.

> > More importantly what is the effect of NOINLINE if a user
> > does not specify the -flto option?  Does this block inlining
> > regardless of LTO?
> >
> > --
> > steve
> Yes, there is no way to differentiate between LTO and non-LTO
> compilations (at least from what I have seen in the code).
> As long as subroutines/functions are in separate compilation units,
> this has no effect for non-LTO builds anyway.  Main issue is to deal
> with unintentional over inlining between different compilation units
> with lto1 backend.

I haven't studied your patch in detail, so apologies up front
if this is already available.  Can attribute be applied to only
a block of code in a file?.  Suppose there are 3 functions in a
file.  Can the attribute be toggled on and off? Something like


function bar()
...
end function bar()

!GCC$ ATTRIBUTES noinline on
function foo()
...
end function foo()
!GCC$ ATTRIBUTES noinline off

function bah()
...
end function bah()

bar() and bah() can be inlined while inlining foo() is prevented.

-- 
Steve

  reply	other threads:[~2023-02-10 18:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  5:42 Rimvydas Jasinskas
2023-02-10  8:24 ` Steve Kargl
2023-02-10  8:38   ` Rimvydas Jasinskas
2023-02-10 18:53     ` Steve Kargl [this message]
2023-02-10 21:07 ` Harald Anlauf
2023-02-10 21:16   ` Steve Kargl
2023-02-10 22:16   ` Rimvydas Jasinskas
2023-02-11 21:26     ` Harald Anlauf
2023-02-12  6:59       ` Rimvydas Jasinskas
2023-02-12 21:28         ` Harald Anlauf
2023-02-13 17:50           ` Harald Anlauf
2023-02-14  9:35             ` nvptx: Adjust 'scan-assembler' in 'gfortran.dg/weak-1.f90' (was: Support for NOINLINE attribute) Thomas Schwinge
2023-02-14 19:55               ` Harald Anlauf
2023-02-15 20:58                 ` Support for WEAK attribute, part 2 Rimvydas Jasinskas
2023-02-16 21:50                   ` Harald Anlauf
2023-02-23 13:55                     ` Rimvydas Jasinskas
2023-02-23 20:53                       ` Harald Anlauf
2023-02-24  5:16                         ` Rimvydas Jasinskas
2023-02-24 22:03                           ` Harald Anlauf
2023-03-28 21:06                           ` Enable 'gfortran.dg/weak-2.f90' for nvptx target (was: Support for WEAK attribute, part 2) Thomas Schwinge
2023-02-18 20:35 ` Support for NOINLINE attribute Bernhard Reutner-Fischer
2023-02-24  7:19   ` Bernhard Reutner-Fischer
2023-02-24 12:02     ` Rimvydas Jasinskas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+aSlsgPmcyVqkB8@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=fortran@gcc.gnu.org \
    --cc=rimvydasjas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).