From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 7A2C53858C20 for ; Wed, 9 Mar 2022 05:25:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A2C53858C20 Received: by mail-pf1-x430.google.com with SMTP id s8so1260231pfk.12 for ; Tue, 08 Mar 2022 21:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GSBsqIqlD1G4qxtmlBPxlsZcfaTdYe8mHkkuAF9Lsio=; b=QuHGLLKQIIMzgtHKQoGgTq28mslraGxMrmf12NlC5Zx7uSEdiQa0p4EtnZscWO68rr mjOhMJrS8EXlIVBZxQ88pyJZGVbJwjfdcqvOjKAc6YlENNVcnCMkAzDTPnuwuC7aDp0M XNwq4RYlC38KqUjWJPE+aIavY8T0TX/VHekYL618nsDRFu21BSLKX0eKI5bKD+ErKbtt Q2ixffjAYCCTyvkGJnZoJT6MpPjIamFbc5eFHqcRyWl5ddcb/h9Rqm3yZBsCiT+g/mIj wievPmNrVPkbpGvZ0SK6NiIZJ0zSNgHj3BGv0yELq9UXuF8P6jEmRWjzJmE/BmtQ1ecH sgiA== X-Gm-Message-State: AOAM531ZRJdTsp3ELREcWQoPSigvxFXESOL62IKeAfz7dhCnvhgYe0oQ yPbtOgBplCINimobRV/UgNFH6sCLgcI= X-Google-Smtp-Source: ABdhPJz5acqhjhGLTIcLAjwk9TLE72Pas5ZVkR4a3Ptw0KJjqt7HohsRvoTinPZVUBzomJ9ALFF6UQ== X-Received: by 2002:a63:1245:0:b0:375:57f0:8798 with SMTP id 5-20020a631245000000b0037557f08798mr17751033pgs.490.1646803512108; Tue, 08 Mar 2022 21:25:12 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:aa4:674:e537:bdb6]) by smtp.gmail.com with ESMTPSA id z21-20020a17090a8b9500b001bf74f8bb3asm4671968pjn.24.2022.03.08.21.25.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 21:25:11 -0800 (PST) From: Alan Modra To: binutils@sourceware.org Subject: [PATCH 0/2] rh2059646 - compilation of prusa-slicer hangs Date: Wed, 9 Mar 2022 15:55:04 +1030 Message-Id: <20220309052506.4000271-1-amodra@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3029.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 05:25:14 -0000 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(-)