From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12455 invoked by alias); 4 May 2011 14:28:13 -0000 Received: (qmail 12442 invoked by uid 22791); 4 May 2011 14:28:12 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 14:27:59 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/48866] gcc hangs when -g is set X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 04 May 2011 14:28:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00329.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48866 --- Comment #4 from Jakub Jelinek 2011-05-04 14:21:28 UTC --- The problem is the MEMs nested in other MEM addresses, cselib isn't prepared to handle it efficiently. So, either we should break very deep MEM nests using extra DEBUG_INSNs and debug temporaries (not sure how easy it would be to break them during expand_debug_expr, so perhaps either when expand_debug_expr finishes, or perhaps during vt_initialize before an insn is passed to cselib_process_insn), or cselib would need to have some cache on MEMs it already looked up during current toplevel cselib_lookup or cselib_subst_to_values calls - for small number of MEMs perhaps a linear cache that cselib_lookup_mem could iterate over, holding MEM rtx / corresponding cselib_val * pairs, for bigger amounts perhaps pointer_map. Without such a cache, 14 nested MEMs result in certainly more than 4 billion cselib_lookup searches within one cselib_process_insn.