From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18386 invoked by alias); 27 Jan 2015 12:02:31 -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 Received: (qmail 18290 invoked by uid 48); 27 Jan 2015 12:02:16 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/64817] [5 Regression] compilation hangs at -O3 with -g enabled on x86_64-linux-gnu Date: Tue, 27 Jan 2015 12:02:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03061.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64817 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aoliva at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- The problem is that expand_debug_expr follows all TER definitions for SSA_NAMEs, and in this testcase it just creates really huge expression that we then try to simplify, and nonzero_bits have bad time complexity for such large expressions. pretmp_33 = a; a.1_6 = pretmp_33 & 231; a.2_21 = a.1_6 ^ 14; a.1_22 = a.2_21 & 231; a.2_17 = a.1_22 ^ 14; a.1_19 = a.2_17 & 231; a.2_37 = a.1_19 ^ 14; a.1_28 = a.2_37 & 231; a.2_29 = a.1_28 ^ 14; a.1_42 = a.2_29 & 231; a.5_41 = a.1_42 ^ 15; # DEBUG D#1 => a.5_41 < 0 # DEBUG e => (int) D#1 a.1_14 = a.5_41 & 231; a.2_25 = a.1_14 ^ 14; a.1_13 = a.2_25 & 231; a.2_44 = a.1_13 ^ 14; a.1_45 = a.2_44 & 231; a.2_46 = a.1_45 ^ 14; a.1_47 = a.2_46 & 231; a.2_48 = a.1_47 ^ 14; a.1_49 = a.2_48 & 231; a.5_51 = a.1_49 ^ 15; # DEBUG D#1 => a.5_51 < 0 # DEBUG e => (int) D#1 a.1_56 = a.5_51 & 231; a.2_57 = a.1_56 ^ 14; a.1_58 = a.2_57 & 231; a.2_59 = a.1_58 ^ 14; a.1_60 = a.2_59 & 231; a.2_61 = a.1_60 ^ 14; a.1_62 = a.2_61 & 231; a.2_63 = a.1_62 ^ 14; a.1_64 = a.2_63 & 231; a.5_66 = a.1_64 ^ 15; # DEBUG D#1 => a.5_66 < 0 # DEBUG e => (int) D#1 ... Best would be to limit somehow the number of nested: case SSA_NAME: { gimple g = get_gimple_for_ssa_name (exp); if (g) { op0 = expand_debug_expr (gimple_assign_rhs_to_tree (g)); if (!op0) return NULL; } levels, perhaps by adding DEBUG_EXPR_DECLs to break too deep chains. Supposedly it would need to be done at the end of TER or so, simply for all debug stmts, look at the nesting depth of get_gimple_for_ssa_name links from their expressions, and if it goes over say 5 or 10, add some DEBUG_EXPR_DECLs and debug stmts for them right after the corresponding SSA_NAME definitions and replace all debug uses of the SSA_NAME with that DEBUG_EXPR_DECL. Alex, what do you think about that?