highway icon indicating copy to clipboard operation
highway copied to clipboard

Problem building 0.17.0 on aarch64 with GCC

Open eclipseo opened this issue 2 years ago • 14 comments

Hello again,

While building highway 0.17.0 with gcc 12.1.1 on aarch64, the build gets stuck at 98%. For a whole night. See for example https://koji.fedoraproject.org/koji/taskinfo?taskID=88443347 (check build.log), which is stuck since yesterday evening.

Building 0.16.0 with the same configuration works with no issue. Building with Clang also works.

I'm sorry I can't provide more information than that, there is no error displayed anywhere, nothing showing up on the logs.

Did your release build with no problem on aarch64 on Qemu?

eclipseo avatar Jun 19 '22 10:06 eclipseo

:) I can confirm that HEAD compiles with gcc 11 on aarch64, as mentioned in g3doc/release_testing_process.md.

The last four targets to be built are memory_test, sort_test, dot_test, logical_test. Looks like it is memory_test that's missing for you?

Without the Werror that we usually run with (also seeing the warnings in system headers present in your logs), and gcc12, I also see memory_test taking a long time. Would you like to file a bug report? Of course we'll have to deal with the existing gcc12, I'll look for a workaround.

jan-wassenberg avatar Jun 20 '22 09:06 jan-wassenberg

I've narrowed it down to the tests for LoadInterleaved3 or 4 - either causes long builds. Without those, aarch64 gcc 12 builds of memory_test take about 18s on my machine.

BTW we've seen a couple of SIMD-related regressions in gcc. Do you think they might be interested in running Highway tests as part of their release testing? Seems like that would increase their test coverage.

jan-wassenberg avatar Jun 20 '22 10:06 jan-wassenberg

I don't really have contact with GCC folks, you might be more adequate to explain why highway should be included in their battery of tests.

eclipseo avatar Jun 20 '22 13:06 eclipseo

:) FYI filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106041.

jan-wassenberg avatar Jun 21 '22 07:06 jan-wassenberg

FYI, This is the opposite on armhf:

  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106187

Using -01 seems to fix the symptoms:

  • https://buildd.debian.org/status/fetch.php?pkg=highway&arch=armhf&ver=0.17.0-9&stamp=1657025640&raw=0

malaterre avatar Jul 04 '22 16:07 malaterre

@malaterre the gcc folks need a preprocessed source file, not an object file. You get those by adding -save-temps to your compiler flags.

stefson avatar Jul 07 '22 15:07 stefson

@stefson the file is 100k lines, I suspect they need something much much smaller (IMHO).

malaterre avatar Jul 07 '22 15:07 malaterre

Not sure what file size your refere to by 100k lines, but those preprocessed sources are easily a tenfold bigger than the object files. Just xz them and see if its small enough to allow an upload to the gcc bug tracker.

You can of course also attach it here as a zip archive, but I'm not an compiler expert at all :-)

stefson avatar Jul 07 '22 15:07 stefson

Preprocessed files are usually huge simply because of all the system headers. No worries about size, xz is a good suggestion for that :)

jan-wassenberg avatar Jul 07 '22 16:07 jan-wassenberg

FYI the investigation in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106187 seems indeed to point to a compiler issue.

jan-wassenberg avatar Jul 22 '22 14:07 jan-wassenberg

I believe this will be fixed in the next GCC release. Big thanks to @malaterre for frequent followups and providing information that helped the compiler devs :)

jan-wassenberg avatar Sep 05 '22 06:09 jan-wassenberg

hmm, I believe the armhf issue has been fixed, but the original issue was against aarch64 and that one is not yet fixed, at least if you consider the gcc bugtracker, right?

stefson avatar Sep 05 '22 08:09 stefson

Tried just now on openSUSE Tumbleweed aarch64, with GCC 12.2.1+git416 and the build still hangs.

ggardet avatar Sep 05 '22 13:09 ggardet

Indeed, thanks @ggardet and @stefson for following up, let's re-open. Is this despite the #if HWY_COMPILER_GCC_ACTUAL >= 1200 && HWY_ARCH_ARM_A64 workaround in interleaved_test.cc?

jan-wassenberg avatar Sep 06 '22 09:09 jan-wassenberg

I see this has been fixed 2 weeks ago in GCC (tracker). Per the comments there, GCC 12 is affected. I'm tempted to disable the LoadInterleaved3/4 test on GCC with a todo to re-enable them after the next GCC release. Please let us know if you prefer a different approach.

jan-wassenberg avatar Mar 02 '23 09:03 jan-wassenberg