qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] configure: Improve alias attribute check


From: Gavin Shan
Subject: Re: [PATCH] configure: Improve alias attribute check
Date: Sun, 21 Mar 2021 10:36:47 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]