public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>,
	Fangrui Song <maskray@google.com>
Cc: Nicholas Guriev <nicholas@guriev.su>, libc-alpha@sourceware.org
Subject: Re: [PATCH v3] elf: Rewrite long RESOLVE_MAP macro to a debug friendly function
Date: Mon, 23 May 2022 13:22:11 -0300	[thread overview]
Message-ID: <9db7a4b9-7b2a-78fd-a42e-9f8470060ce2@linaro.org> (raw)
In-Reply-To: <92df96d2-1e71-53eb-7878-636f52913d07@gotplt.org>



On 23/05/2022 10:02, Siddhesh Poyarekar wrote:
> On 23/05/2022 18:05, Adhemerval Zanella wrote:
>> I think the main issue is we build glibc with -fgnu89-inline, which is required
>> due some optimizations where a function is defined without inline, but then
>> it has an inline definition to be used internally.
> 
> I'm not sure I understand, could you please elaborate?

I was in fact referring to another issues (the -fgnu89-inline) where it would
only affect either 'extern inline' or 'inline' functions.
> 
>> Also, since we don't use -Winline we can't assure that compiler won't emit the
>> function definition where gcc documents it might [1].  So I think one exercise
>> we might do it to remove all __always_inline__, and add -Winline to see which
>> functions, if any, won't be inline by compiler.
> 
> How would that help though?  That output is bound to change as the compiler or even the code base changes since the decision to inline (when __always_inline__ is not specified) is determined heuristically. In my understanding, the point of __always_inline__ use in the sources is to make inlining deterministic.

From ed159672eb3cd650a32b7e5cb4d5ec1fe0e63802 I take that even always_inline
might fail for some reason.  So we need to keep using always_inline on function
that need to be inline to get a compiler warning if it can not be done.

I think by using -Winline with stardand C99 static inline, besides being 
slight more portable code is also less error prone (since it is one less
annotation to take care of).  It would be slight better to setup -Winline 
per TU, instead of global since we only need always_inline semantic for 
specific usages.

In the end I think both a pretty equivalent. 

> 
>> I would like also to eventually remove -fgnu89-inline, since I think we can
>> restructure the code to not rely on extern inlines nor on the internal inline
>> optimizations.  Also, it seems that although clang seems to support
>> -fgnu89-inline, it has subtle different semantics that breaks some internal
>> glibc assumptions.
> 
> Could you elaborate on this too?

In fact revising my clang branch, I disable extern inlines because another clang
issues; not because it handles -fgnu89-inline differently. Sorry for the noise.

  reply	other threads:[~2022-05-23 16:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 14:51 [PATCH] " Nicholas Guriev
2022-05-02 21:20 ` Fangrui Song
2022-05-03 10:04   ` Nicholas Guriev
2022-05-03 20:12     ` Fāng-ruì Sòng
2022-05-07 13:33       ` [PATCH v3] " Nicholas Guriev
2022-05-09 13:38         ` Siddhesh Poyarekar
2022-05-14 14:27           ` Nicholas Guriev
2022-05-14 22:48             ` Fangrui Song
2022-05-15  0:58               ` Siddhesh Poyarekar
2022-05-22 22:24                 ` Fangrui Song
2022-05-23  7:28                   ` Siddhesh Poyarekar
2022-05-23 12:35                   ` Adhemerval Zanella
2022-05-23 13:02                     ` Siddhesh Poyarekar
2022-05-23 16:22                       ` Adhemerval Zanella [this message]
2022-05-23 16:33                         ` Siddhesh Poyarekar
2022-05-23 16:56                           ` Adhemerval Zanella
2022-05-03 19:14   ` [PATCH v2] " Nicholas Guriev

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=9db7a4b9-7b2a-78fd-a42e-9f8470060ce2@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    --cc=nicholas@guriev.su \
    --cc=siddhesh@gotplt.org \
    /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).