https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #11 from bugreporter66 at gmail dot com ---
Created a QEMU bug here:
https://gitlab.com/qemu-project/qemu/-/issues/1547
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #10 from bugreporter66 at gmail dot com ---
I checked the simple version of the test with QEMU 6.2.0 and 7.0.0:
ubuntu-mate@ubuntu-mate:~/Downloads/test_p64$
ubuntu-mate@ubuntu-mate:~/Downloads/test_p64$ powerpc64le-linux-gnu-g++ -O
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #9 from bugreporter66 at gmail dot com ---
Created attachment 54683
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54683&action=edit
sample_p64
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #7 from bugreporter66 at gmail dot com ---
Good to know. I will file a QEMU bug then. Thank you for your efforts.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #5 from bugreporter66 at gmail dot com ---
The exact command line used to produce the new binaries (added -static):
ubuntu-mate@ubuntu-mate:~/Downloads/bug$ powerpc64le-linux-gnu-g++ -o
test_p64-test{0,.ii} -mcpu=power9 -O0 -fpie -p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #4 from bugreporter66 at gmail dot com ---
The test prints two array values (farr[11], farr[3]) and then calculates and
prints their respective minimum and maximum values. The first line
(unoptimized) is a correct behavior (only showi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #3 from bugreporter66 at gmail dot com ---
Created attachment 54680
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54680&action=edit
binaries and output files as text
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #19 from bugreporter66 at gmail dot com ---
On the side note, my POWER8 machine can only run Ubuntu 16.04 LTS and Ubuntu
18.04 LTS, later releases simply won't boot. So it's getting outdated anyway.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #18 from bugreporter66 at gmail dot com ---
I noticed that building on newer Linux distros often produces a binary that
then cannot run on older ones even with the same CPU, it requires newer
libraries at runtime (tried that with x86_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #14 from bugreporter66 at gmail dot com ---
I should be able to workaround that by emulating all LE targets on POWER9, with
a comment that building for POWER8 natively on target should work too.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #12 from bugreporter66 at gmail dot com ---
Yep, thanks.
At least I've learned how to debug with QEMU and GDB and I think building
without -static should still produce code compatible with POWER8 for the actual
target, but not for QE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #10 from bugreporter66 at gmail dot com ---
Yes, it seems so. They've switched to POWER9 by default in Ubuntu 22.04, so it
means that gcc itself (along with standard libraries) was compiled for POWER9
as well. It used to be POWER8 in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #8 from bugreporter66 at gmail dot com ---
Created attachment 54583
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54583&action=edit
Screenshot with GDB+disassembly
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #7 from bugreporter66 at gmail dot com ---
After disassembling the instruction in question is stxv at 100034b0:
10003470 <_GLOBAL__sub_I_eh_alloc.cc>:
10003470: 15 10 40 3c lis r2,4117
10003474: 00 7c 42 3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #5 from bugreporter66 at gmail dot com ---
Created attachment 54582
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54582&action=edit
Screenshot with QEMU+GDB
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #4 from bugreporter66 at gmail dot com ---
I did the remote debugging as suggested by Andrew Pinski and it seems to fail
somewhere in _GLOBAL__sub_i_eh_alloc.cc
After connecting to qemu from gdb I issued step command and the program
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
--- Comment #3 from bugreporter66 at gmail dot com ---
Thanks, I will try to find out and be more specific where exactly it leaks.
It was my first attempt at reducing the code that would fit into 1MB
attachment.
Checked g++ 10.4 today, it works
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
--- Comment #1 from bugreporter66 at gmail dot com ---
Checked g++ 10.4 today, it works as it should.
11.3 and 12.1 were tested to show the issue so far.
The command line for building:
powerpc64le-linux-gnu-g++ -O2 -static test.cpp -o test_p64
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109007
Bug ID: 109007
Summary: building for POWER8 leaks into POWER9 ISA with g++
11.3 (cross-compiler on x86_64 host)
Product: gcc
Version: 11.3.0
Status: UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109004
Bug ID: 109004
Summary: wrong code for -O2 (any above -O0) with g++ 11.3 for
POWER9 (cross-compiler on x86_64 host)
Product: gcc
Version: 11.3.0
Status: UNCONFIRMED
20 matches
Mail list logo