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