From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD6533858426; Fri, 12 Jan 2024 18:31:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD6533858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705084267; bh=99uvTyGYWwYcJamtCOuQEUwg3WwkxzGnv11NOnKleQg=; h=From:To:Subject:Date:From; b=Rqy2VRqo7pydvhUzc+DgkFJtac/EEL2okxvapiaOKyv5CI9AZrQk8tYsdI3jIEpci 9GY+adgl8Z3ZJtTY7cJlZ7gsEwVOl9yxiMbSd9+J2HpWylYrFk48lTZN7SSmjtPXS4 8tSpDeQBlclDLQcKjARuomBXgrvlBJhyHZqEbatU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113359] New: [13 Regression] LTO miscompilation of ceph on aarch64 Date: Fri, 12 Jan 2024 18:31:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113359 Bug ID: 113359 Summary: [13 Regression] LTO miscompilation of ceph on aarch64 Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- As mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=3D2241339 when ceph is compiled with LTO on aarch64 _M_emplace_equal > > const, Context*>&> is changed by SRA to only store 64 + 32 bits into the std::pair rather than= 64 + 64 bits. Reproducer: ./xg++ -B ./ -O2 -flto=3Dauto -ffat-lto-objects -fexceptions -g -Wall -Wno-complain-wrong-lang -Werror=3Dformat-security -fstack-protector-strong -mbranch-protection=3Dstandard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-point= er -std=3Dc++20 -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-rea= lloc -fno-builtin-free -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=3Dformat-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fstack-protector-strong -fdiagnostics-color=3Dauto -c Timer.ii ./xg++ -B ./ -O2 -flto=3Dauto -ffat-lto-objects -fexceptions -g -Wall -Wno-complain-wrong-lang -Werror=3Dformat-security -fstack-protector-strong -mbranch-protection=3Dstandard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-point= er -std=3Dc++20 -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-rea= lloc -fno-builtin-free -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=3Dformat-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fstack-protector-strong -fdiagnostics-color=3Dauto -c SloppyCRCMap.ii ./xg++ -B ./ -O2 -c CrtStuff.i ./xg++ -B ./ -flto=3Dauto -shared -o out.so SloppyCRCMap.o Timer.o CrtStuff= .o -nostdlib grep_cleanup() { c++filt | grep -A16 '_M_emplace_equal:' | sed 's/[^:]*: *//' } diff -u <(aarch64-linux-gnu-objdump -d Timer.o | grep_cleanup) <(aarch64-linux-gnu-objdump -d out.so | grep_cleanup) which prints --- /dev/fd/63 2024-01-12 19:24:37.317433462 +0100 +++ /dev/fd/62 2024-01-12 19:24:37.318433448 +0100 @@ -7,11 +7,11 @@ d2800600 mov x0, #0x30 // #48 f90013f5 str x21, [sp, #32] aa0103f5 mov x21, x1 - 94000000 bl 0 + 97fff0bc bl 6ee0 aa0003f4 mov x20, x0 f9400a62 ldr x2, [x19, #16] 91002263 add x3, x19, #0x8 f94002a7 ldr x7, [x21] f9001007 str x7, [x0, #32] - f94006a0 ldr x0, [x21, #8] - f9001680 str x0, [x20, #40] + b9400aa1 ldr w1, [x21, #8] + b9002801 str w1, [x0, #40] i.e. the -ffat-lto-objects non-LTO compilation stores 64-bit pointers at the new returned pointer + 32 and + 40, while LTO stores 64-bit pointer only to the former and 32-bit into the latter. In *.cplxlower1 I still see MEM[(struct pair *)_37 + 32B] =3D ISRA.253; where struct pair ISRA.253; but sra has: Created a replacement for ISRA.253 offset: 0, size: 64: SR.256D.22298 Created a replacement for ISRA.253 offset: 64, size: 32: SR.257D.22299 >From what I can see, that should be std::multimap::value_type, i.e. std::pair=