When GCC is invoked in some autotools configure scripts, the script hangs at with a message like: checking whether printf supports infinite 'long double' arguments... This is perfectly reproducible when emerging app-arch/gzip (for example). Doing an "iperf top" shows that cc1 is spinning in the C function "real_to_decimal_for_mode". The issue comes from using "-O3" or "-O2 -ftree-vectorize" in CFLAGS so as soon as the vectorization is enabled. Tested in my production environment and a brand new testing environment mounted from a very recent stage3 archive. Not tested with a vanilla GCC 10.1, yet. Reproducible: Always
"iperf top" => "perf top" sorry for the typo.
(In reply to Adrien Dessemond from comment #0) > When GCC is invoked in some autotools configure scripts, the script hangs at > with a message like: > checking whether printf supports infinite 'long double' arguments... > > This is perfectly reproducible when emerging app-arch/gzip (for example). > > Doing an "iperf top" shows that cc1 is spinning in the C function > "real_to_decimal_for_mode". > > The issue comes from using "-O3" or "-O2 -ftree-vectorize" in CFLAGS so as > soon as the vectorization is enabled. > > Tested in my production environment and a brand new testing environment > mounted from a very recent stage3 archive. > > Not tested with a vanilla GCC 10.1, yet. > > > Reproducible: Always Can you provide 'emerge --info' and 'build.log' of a hung gzip?
Created attachment 638652 [details] build.log of app-arch/gzip Log of "emerge app-arch/gzip", the last line is where the configure script hungs at. (Ctrl-C pressed).
Created attachment 638654 [details] emerge --info -march=native => znver2 (AND Zen 2)
Created attachment 638660 [details] perf top at the time the configure script hangs Revisiting this report a bit, we see what is attached in 'perf_top.log' when the hangs occurs.
Can you extract exact .c source file that configure is running on your machine and verify it still hangs on the same compiler flags running manually? config.log should contain the compiler command and https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide has hints on how to extract preprocessed file.
Reproduced locally. I should be able to proceed myself.
The following seems to be an enough reproducer: // $ cat bug.c void a(); void b() { union { int c[4]; long double d; } e = {{0, 0, 4}}; a(e.d); } $ /usr/bin/x86_64-pc-linux-gnu-gcc -o conftest -O3 -fopt-info-vec -c bug.c <hangs> You might want to remove -fopt-info-vec as a workaround meanwhile.
Reported upstream as https://gcc.gnu.org/PR95118
I removed "-fopt-info-vec" and the hang does not occur. Good catch, thank you so much for your quick handling.
After applying the upstream commit 568c985113b29574c4e25e1a016475668fc17c28 to the file real.c (see https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=568c985113b29574c4e25e1a016475668fc17c28 ), the hang does not occur anymore.
Created attachment 638984 [details] Proposed addition to the "Gentoo patch set" for GCC I have added this file to my local copy of gcc-10.1.0-patches-1.tar.bz2. GCC 10.1.0 can be emerged builds without any issue and the emerged GCC does not hang anymore with -fopt-info-vec :)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c355f9b13f537be7717c3dafe1510976cdb8584e commit c355f9b13f537be7717c3dafe1510976cdb8584e Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-05-14 17:57:26 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-05-14 17:57:26 +0000 10.1.0: backport infinite loop in float print, bug #722774 Reported-by: Adrien Dessemond Bug: https://gcc.gnu.org/PR95118 Bug: https://bugs.gentoo.org/722774 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.1.0/gentoo/29_all_fix-float-hang-PR95118.patch | 54 +++++++++++++++++++++++ 10.1.0/gentoo/README.history | 3 ++ 2 files changed, 57 insertions(+)
Queued the fix for next patchset of gcc (might take weeks to months to get to gentoo). Meanwhile you can drop the patch to /etc/portage/patches/ and see if it works for you.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3c29cc8edec29f4cc48ffc77004cfd9d06b220c7 commit 3c29cc8edec29f4cc48ffc77004cfd9d06b220c7 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-06-11 22:52:51 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-06-11 22:52:51 +0000 10.1.0: cut 2 patchset Four new patches: + 29_all_fix-float-hang-PR95118.patch: fix looping in printing real numbers + 30_all_lto-intl-workaround-PR95194.patch: add a workaround to fix gettext LTO + 31_all_ctor-range-PR95241.patch: fix constexpr constructors with ranges + 32_all_plugin-objdump.patch: user tuple-prefixed objdump Bug: https://gcc.gnu.org/PR95118 Bug: https://bugs.gentoo.org/722774 Reported-by: Andrew Savchenko Bug: https://gcc.gnu.org/PR95194 Bug: https://bugs.gentoo.org/723370 Bug: https://gcc.gnu.org/PR95241 Bug: https://bugs.gentoo.org/726644 Bug: https://gcc.gnu.org/PR95648 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.1.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=376f4a461521d7d7482c6ba4bc34a798bca0a120 commit 376f4a461521d7d7482c6ba4bc34a798bca0a120 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-06-11 23:01:24 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-06-11 23:05:10 +0000 sys-devel/gcc: 10.1.0: cut 2 patchset Four new patches: + 29_all_fix-float-hang-PR95118.patch: fix looping in printing real numbers + 30_all_lto-intl-workaround-PR95194.patch: add a workaround to fix gettext LTO + 31_all_ctor-range-PR95241.patch: fix constexpr constructors with ranges + 32_all_plugin-objdump.patch: user tuple-prefixed objdump Bug: https://gcc.gnu.org/PR95118 Closes: https://bugs.gentoo.org/722774 Reported-by: Andrew Savchenko Bug: https://gcc.gnu.org/PR95194 Closes: https://bugs.gentoo.org/723370 Bug: https://gcc.gnu.org/PR95241 Closes: https://bugs.gentoo.org/726644 Bug: https://gcc.gnu.org/PR95648 Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-10.1.0-r1.ebuild | 13 +++++++++++++ 2 files changed, 14 insertions(+)