qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Cc: thuth@redhat.com, qemu-arm@nongnu.org, philmd@redhat.com,
	laurent@vivier.eu, shan.gavin@gmail.com
Subject: Re: [PATCH] configure: Improve alias attribute check
Date: Sun, 21 Mar 2021 10:36:47 +1100	[thread overview]
Message-ID: <0798e22b-4aed-7f72-5e77-4520d9cc010b@redhat.com> (raw)
In-Reply-To: <107a73a0-aafe-bfce-7c28-8ed5fe6c022f@linaro.org>

Hi Paolo and Richard,

On 3/21/21 9:33 AM, Richard Henderson wrote:
> On 3/20/21 11:52 AM, Paolo Bonzini wrote:
>>> +int main(void)
>>> +{
>>> +    return read_y();
>>> +}
>>
>> I think this should be "read_y() == 1 ? 0 : 1".
> 
> As a testcase returning 0 on success, yes.
> 

Ok. I will include the changes in v2. Also, I will
wrap the lines, for example:

int main(void) { return (read_y() == 1) ? 0 : 1; }

if compile_prog "" "" && $TMPE >/dev/null 2>/dev/null; then
    attralias=yes
fi

>> I can reproduce it with -flto -O2 but not without -flto, do you agree?
> 
> Agreed.  Replicated with a random recent gcc 11 snapshot.
> This is really annoying of lto.  It's clear something needs to change though.
> 

The command I used is:

gcc -O2 -flto=auto config-temp.c config-temp-b.c -o config-temp.exe.

Removing "-O2" or "-flto=auto" can make the gcc alias attribute workable again.

>> Perhaps we can obtain the same optimization by wrapping reads of the page size in an inline __attribute__((const)) function.  Richard, what do you think?
> 
> I'll give it a shot and see what happens.
> 

Thanks,
Gavin



  reply	other threads:[~2021-03-20 23:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  4:27 [PATCH] configure: Improve alias attribute check Gavin Shan
2021-03-20  4:48 ` Thomas Huth
2021-03-20 23:32   ` Gavin Shan
2021-03-20 17:52 ` Paolo Bonzini
2021-03-20 22:33   ` Richard Henderson
2021-03-20 23:36     ` Gavin Shan [this message]
2021-03-21 15:49     ` Richard Henderson
2021-03-21 16:50       ` Paolo Bonzini
2021-03-21 17:34         ` Richard Henderson
2021-03-21 17:43           ` Paolo Bonzini
2021-03-21 17:46             ` Paolo Bonzini
2021-03-21 18:23               ` Richard Henderson
2021-03-22 10:54                 ` Gavin Shan
2021-03-22 20:59                   ` Richard Henderson
2021-03-23  3:13                     ` Gavin Shan

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=0798e22b-4aed-7f72-5e77-4520d9cc010b@redhat.com \
    --to=gshan@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shan.gavin@gmail.com \
    --cc=thuth@redhat.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 NNTP newsgroup(s).