public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
@ 2022-07-25 2:30 sam at gentoo dot org
2022-07-25 2:31 ` [Bug c/106431] " sam at gentoo dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-07-25 2:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
Bug ID: 106431
Summary: Hang when compiling large printf() file (from glibc's
tst-printf-bz18872) on HPPA with -ggdb3
Product: gcc
Version: 11.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: sam at gentoo dot org
Target Milestone: ---
Created attachment 53343
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53343&action=edit
tst-printf-bz18872.c
tst-printf-bz18872.c
Dumped my initial thoughts at https://bugs.gentoo.org/860819 when found this.
The hang only occurs on a native compiler so far (not cross). Happy to give
access to a machine used for Gentoo testing to aid debugging. Requires -ggdb3
at least, possibly other debugging levels too.
Compiles quickly without -ggdb3 (e.g. hppa2.0-unknown-linux-gnu-gcc -pipe
-march=2.0 -fdiagnostics-show-option -O2 -Wl,-O1 -Wl,--as-needed foo.c).
Noticed when building glibc's test suite on hppa2.0-unknown-linux-gnu and
compilation hanged on:
```
hppa2.0-unknown-linux-gnu-gcc -pipe -march=2.0 -fdiagnostics-show-option
-ggdb3 -O2 -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu
/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/stdio-common/tst-printf-bz18872.c
-c -std=gnu11 -fgnu89-inline -pipe -march=2.0 -fdiagnostics-show-option -ggdb3
-O2 -Wall -Wwrite-strings -Wundef -fmerge-all-constants -frounding-math
-fno-stack-protector -fno-common -Wstrict-prototypes -Wold-style-definition
-fmath-errno -fno-pie -U_FORTIFY_SOURCE -I../include
-I/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/stdio-common
-I/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl
-I../sysdeps/unix/sysv/linux/hppa -I../sysdeps/hppa/nptl
-I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux
-I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/hppa/hppa1.1 -I../sysdeps/wordsize-32
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/hppa/fpu
-I../sysdeps/hppa -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio
-I. -nostdinc -isystem /usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.3.0/include
-isystem /usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.3.0/include-fixed -isystem
/usr/include -D_LIBC_REENTRANT -include
/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/libc-modules.h
-DMODULE_NAME=testsuite -include ../include/libc-symbols.h -DPIC
-DTOP_NAMESPACE=glibc -D_IO_MTSAFE_IO -o
/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/stdio-common/tst-printf-bz18872.o
-MD -MP -MF
/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/stdio-common/tst-printf-bz18872.o.dt
-MT
/var/tmp/portage/sys-libs/glibc-9999/work/build-hppa-hppa2.0-unknown-linux-gnu-nptl/stdio-common/tst-printf-bz18872.o
```
As far as I can tell, GCC invokes `as` and then it hangs indefinitely.
I can reproduce this outside of glibc's test suite with the attached file:
```
$ hppa2.0-unknown-linux-gnu-gcc -pipe -march=2.0 -g -O2 -Wl,-O1 -Wl,--as-needed
foo.c -v
Using built-in specs.
COLLECT_GCC=hppa2.0-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/11.2.1/lto-wrapper
Target: hppa2.0-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/configure
--host=hppa2.0-unknown-linux-gnu --build=hppa2.0-unknown-linux-gnu
--prefix=/usr --bindir=/usr/hppa2.0-unknown-linux-gnu/gcc-bin/11.2.1
--includedir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/include
--datadir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/11.2.1
--mandir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/11.2.1/man
--infodir=/usr/share/gcc-data/hppa2.0-unknown-linux-gnu/11.2.1/info
--with-gxx-include-dir=/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/include/g++-v11
--with-python-dir=/share/gcc-data/hppa2.0-unknown-linux-gnu/11.2.1/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
11.2.1_p20220115 p4' --disable-esp --enable-libstdcxx-time
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--disable-fixed-point --enable-libgomp --disable-libssp --disable-libada
--disable-cet --disable-systemtap --disable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --without-zstd --enable-lto
--without-isl --disable-libsanitizer --enable-default-pie --disable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220115 (Gentoo 11.2.1_p20220115 p4)
COLLECT_GCC_OPTIONS='-pipe' '-march=2.0' '-g' '-O2' '-v' '-dumpdir' 'a-'
/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/11.2.1/cc1 -quiet -v foo.c -quiet
-dumpdir a- -dumpbase foo.c -dumpbase-ext .c -march=2.0 -g -O2 -version -o - |
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/../../../../hppa2.0-unknown-linux-gnu/bin/as
-v -o /tmp/cc55yIsl.o
GNU assembler version 2.37 (hppa2.0-unknown-linux-gnu) using BFD version
(Gentoo 2.37_p1 p2) 2.37
GNU C17 (Gentoo 11.2.1_p20220115 p4) version 11.2.1 20220115
(hppa2.0-unknown-linux-gnu)
compiled by GNU C version 11.2.1 20220115, GMP version 6.2.1, MPFR
version 4.1.0-p13, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/../../../../hppa2.0-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/include
/usr/lib/gcc/hppa2.0-unknown-linux-gnu/11.2.1/include-fixed
/usr/include
End of search list.
GNU C17 (Gentoo 11.2.1_p20220115 p4) version 11.2.1 20220115
(hppa2.0-unknown-linux-gnu)
compiled by GNU C version 11.2.1 20220115, GMP version 6.2.1, MPFR
version 4.1.0-p13, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3ab426cd01445a24f61f58c0075b5617
```
If I omit -pipe, I get the same hanging, but:
```
22453 pts/5 Ss 0:00 \_ -/bin/bash
22926 pts/5 S+ 0:00 | \_ hppa2.0-unknown-linux-gnu-gcc -march=2.0
-fdiagnostics-show-option -ggdb3 -O2 -Wl,-O1 -Wl,--as-needed foo.c -v
22927 pts/5 R+ 0:49 | \_
/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/11.2.1/cc1 -quiet -v -dD foo.c
-quiet -dumpdir a- -dumpbase foo.c -dumpbase-ext .c -march=2.0 -ggdb3 -O2
-version -fdiagnostics-show-option -o /tmp/ccuAnphe.s
```
At least on one machine, it did eventually terminate, after 30m.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/106431] Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
@ 2022-07-25 2:31 ` sam at gentoo dot org
2022-07-25 9:35 ` [Bug debug/106431] " rguenth at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-07-25 2:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
--- Comment #1 from Sam James <sam at gentoo dot org> ---
(Ignore the comment about `as` hanging, that's just a side-effect of -pipe,
which I didn't clock at first.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/106431] Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
2022-07-25 2:31 ` [Bug c/106431] " sam at gentoo dot org
@ 2022-07-25 9:35 ` rguenth at gcc dot gnu.org
2022-07-25 18:17 ` sam at gentoo dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-25 9:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
can you try if -fno-var-tracking helps?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/106431] Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
2022-07-25 2:31 ` [Bug c/106431] " sam at gentoo dot org
2022-07-25 9:35 ` [Bug debug/106431] " rguenth at gcc dot gnu.org
@ 2022-07-25 18:17 ` sam at gentoo dot org
2022-07-25 18:19 ` pinskia at gcc dot gnu.org
2022-07-25 18:23 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-07-25 18:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
--- Comment #3 from Sam James <sam at gentoo dot org> ---
Ah, nice! It's substantially faster (5 seconds) with -fno-var-tracking.
Do you need me to try anything else?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/106431] Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
` (2 preceding siblings ...)
2022-07-25 18:17 ` sam at gentoo dot org
@ 2022-07-25 18:19 ` pinskia at gcc dot gnu.org
2022-07-25 18:23 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-25 18:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The preprocessed source file would be a good idea.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/106431] Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
` (3 preceding siblings ...)
2022-07-25 18:19 ` pinskia at gcc dot gnu.org
@ 2022-07-25 18:23 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2022-07-25 18:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106431
--- Comment #5 from Sam James <sam at gentoo dot org> ---
Created attachment 53349
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53349&action=edit
a-foo.i.xz
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-25 18:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 2:30 [Bug c/106431] New: Hang when compiling large printf() file (from glibc's tst-printf-bz18872) on HPPA with -ggdb3 sam at gentoo dot org
2022-07-25 2:31 ` [Bug c/106431] " sam at gentoo dot org
2022-07-25 9:35 ` [Bug debug/106431] " rguenth at gcc dot gnu.org
2022-07-25 18:17 ` sam at gentoo dot org
2022-07-25 18:19 ` pinskia at gcc dot gnu.org
2022-07-25 18:23 ` sam at gentoo dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).