[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

--- Comment #6 from Andrew Pinski  ---
PR 116065 was never backported to GCC 14 and it is related to early ra but
r15-3509 is after r15-2344 where that was fixed. So that is not it either.

[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

--- Comment #5 from Andrew Pinski  ---
Note I don't think this is the same as PR 121253.

[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-11 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

Sam James  changed:

   What|Removed |Added

   Target Milestone|--- |14.4

--- Comment #1 from Sam James  ---
It starts to work again with >=15 after r15-3509-gd34cda72098867 unfortunately.

[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-11 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

--- Comment #4 from Sam James  ---
(gdb) x/i $pc
=> 0xf7e513a0 
>, llvm::SmallVector const&)+376>: st1 
   {v25.d}[1], [x1]

(gdb) p $x1
$4 = 187649985187848

(gdb) p $v25
$5 = {d = {f = {9.271141112393447e-310, 9.2711411123942375e-310}, u =
{187649985187848, 187649985187864}, s = {187649985187848, 187649985187864}}, s
= {f = {-3.22520005e-13,
  6.12227299e-41, -3.22520439e-13, 6.12227299e-41}, u = {2864025608, 43690,
2864025624, 43690}, s = {-1430941688, 43690, -1430941672, 43690}}, h = {bf =
{-2.682e-29, -3.215e-13,
  -3.02e-13, 0, -2.998e-29, -3.215e-13, -3.02e-13, 0}, f = {-0.0004921,
-0.052399, -0.052063, 0, -0.00049973, -0.052399, -0.052063, 0}, u = {36872,
43701, 43690, 0, 36888, 43701,
  43690, 0}, s = {-28664, -21835, -21846, 0, -28648, -21835, -21846, 0}}, b
= {u = {8, 144, 181, 170, 170, 170, 0, 0, 24, 144, 181, 170, 170, 170, 0, 0}, s
= {8, -112, -75, -86,
  -86, -86, 0, 0, 24, -112, -75, -86, -86, -86, 0, 0}}, q = {u =
{3461531252195915383950146949976072}, s =
{3461531252195915383950146949976072}}}

(gdb) p $v25.d
$6 = {f = {9.271141112393447e-310, 9.2711411123942375e-310}, u =
{187649985187848, 187649985187864}, s = {187649985187848, 187649985187864}}

But it all dies with:
auto symbols = std::make_unique[]>(numShards);

I'm not sure if I understand why make_unique would fail.

[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-10 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

--- Comment #3 from Sam James  ---
Adding __attribute__((optimize("O0"))) to

static std::pair, size_t>
createSymbols(
[...]

is enough to fix it.

[Bug target/121495] [14/15/16 regression] lld miscompiled since r14-6290-g9f0f7d802482a8

2025-08-10 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121495

--- Comment #2 from Sam James  ---
Building the TU with `g++-14 -O2 -fPIC -c SyntheticSections.cpp.ii -o
SyntheticSections.cpp.o` is enough. No standalone testcase yet.