public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] rh2059646 - compilation of prusa-slicer hangs
@ 2022-03-09  5:25 Alan Modra
  2022-03-09  5:25 ` [PATCH 1/2] Reduce duplicated symbol_clone_if_forward_ref work Alan Modra
  2022-03-09  5:25 ` [PATCH 2/2] Constant fold view increment expressions Alan Modra
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Modra @ 2022-03-09  5:25 UTC (permalink / raw)
  To: binutils

rh2059646-reduced.s is a 10M source for one function extracted from
the 386M source attached to
https://bugzilla.redhat.com/show_bug.cgi?id=2059646

Assembly even of the reduced file takes a long time, and the default
stack of 8M is not enough to handle recursion of resolve_symbol_value
starting from case rs_leb128 in gas/write.c:relax_segment.  There is
one extremely long chain of expressions evaluating view numbers,
123582 deep if I calculated correctly.  The source has that many .loc
directives in a row without intervening assembly instructions!

$ time ~/build/gas-virgin/all/gas/as-new -o xxx.o rh2059646-reduced.s
Segmentation fault (core dumped)

real	4m10.792s
user	4m9.810s
sys	0m0.080s

$ ulimit -s 65536
$ time ~/build/gas-virgin/all/gas/as-new -o xxx.o rh2059646-reduced.s

real	37m38.141s
user	37m37.930s
sys	0m0.052s

After applying the following patches:

$ time ~/build/gas/all/gas/as-new -o yyy.o rh2059646-reduced.s

real	0m0.350s
user	0m0.330s
sys	0m0.020s


Alan Modra (2):
  Reduce duplicated symbol_clone_if_forward_ref work
  Constant fold view increment expressions

 gas/dwarf2dbg.c |  1 +
 gas/symbols.c   | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-16 19:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09  5:25 [PATCH 0/2] rh2059646 - compilation of prusa-slicer hangs Alan Modra
2022-03-09  5:25 ` [PATCH 1/2] Reduce duplicated symbol_clone_if_forward_ref work Alan Modra
2022-03-09  5:25 ` [PATCH 2/2] Constant fold view increment expressions Alan Modra
2022-03-09  9:23   ` Fix for bug 28924 Viorel Preoteasa
2022-03-09 11:42     ` Nick Clifton
2022-03-16 19:10       ` Viorel Preoteasa

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).