public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: [PATCH 0/2] rh2059646 - compilation of prusa-slicer hangs
Date: Wed,  9 Mar 2022 15:55:04 +1030	[thread overview]
Message-ID: <20220309052506.4000271-1-amodra@gmail.com> (raw)

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


             reply	other threads:[~2022-03-09  5:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  5:25 Alan Modra [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309052506.4000271-1-amodra@gmail.com \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).