> pwd /usr/src/linux-2.6.19-rc6 > ls COPYING Documentation MAINTAINERS README arch crypto fs init kernel mm scripts sound CREDITS Kbuild Makefile REPORTING-BUGS block drivers include ipc lib net security usr > make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/kconfig/conf.o scripts/kconfig/conf.c: In function 'conf': scripts/kconfig/conf.c:409: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:2750 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Can you attach the preprocessed source?
I dunno, What is the preprocessed source? conf.{c,o}?
(In reply to comment #2) > I dunno, What is the preprocessed source? > conf.{c,o}? The .i file which is produced via adding -save-temps to the command that invokes GCC with. This is all explained in http://gcc.gnu.org/bugs.html.
I see, i will attach the source. But, it takes time, i can't access my computer ATM.
Created attachment 12657 [details] the preprocessed files and output
Reducing.
Confirmed, reduced testcase: struct menu { struct menu *next; struct menu *list; }; char line[128]; int conf_choice(struct menu *menu) { struct menu *child; while (1) { for (child = menu->list; child; child = child->next) { if (menu_is_visible()) break; } if (!child) continue; if (strlen(line) == 100) { f(); continue; } return 1; } }
This worked with "4.3.0 20061112" but fails with "4.3.0 20061119". I think it was caused by: 2006-11-14 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/27755
(gdb) p debug_generic_expr (vh) VH.22 $4 = void (gdb) p debug_generic_expr (eprime) strlen (&lineD.1610) (gdb) p debug_generic_expr (vuse) lineD.1610_11 We have: # NONLOCAL.5_14 = PHI <NONLOCAL.5_18(5)>; # line_11 = PHI <line_17(5)>; <L4>:; # VUSE <line_11>; # VUSE <NONLOCAL.5_14>; D.1623_6 = strlen (&line); if (D.1623_6 == 100) goto <L6>; else goto <L7>; Though the good question is why we have those PHIs still there even though they don't do anything except produce a copy. All the copyprop passes as far as I can tell skip them because they are virtual.
(In reply to comment #9) > Though the good question is why we have those PHIs still there even though they > don't do anything except produce a copy. All the copyprop passes as far as I > can tell skip them because they are virtual. The reason why they still exist is because they have a loop variant on the arugment which causes us to reject it during copyprop (and during dom). I have a patch to remove the conditional on virtual operands but I don't know if this is enough to make sure we never produce this type of PHIs again.
Here is the patch which fixes the PHI issue but I don't know if it will always fix the PRE issue but I think it will as the PRE issue is always with VOPs: Index: tree-ssa-dom.c =================================================================== --- tree-ssa-dom.c (revision 119245) +++ tree-ssa-dom.c (working copy) @@ -1700,8 +1700,10 @@ cprop_operand (tree stmt, use_operand_p depth than the propagatee. Otherwise, this may move loop variant variables outside of their loops and prevent coalescing opportunities. If the value was loop invariant, it will be hoisted - by LICM and exposed for copy propagation. */ - if (loop_depth_of_name (val) > loop_depth_of_name (op)) + by LICM and exposed for copy propagation. We don't care much about + virtual operands. */ + if (loop_depth_of_name (val) > loop_depth_of_name (op) + && is_gimple_reg (val)) return false; /* Dump details. */ @@ -2136,12 +2138,13 @@ static void propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names) { /* First verify that propagation is valid and isn't going to move a - loop variant variable outside its loop. */ + loop variant variable outside its loop except for vops. */ if (! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs) && (TREE_CODE (rhs) != SSA_NAME || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs)) && may_propagate_copy (lhs, rhs) - && loop_depth_of_name (lhs) >= loop_depth_of_name (rhs)) + && (loop_depth_of_name (lhs) > loop_depth_of_name (rhs) + || !is_gimple_reg (lhs))) { use_operand_p use_p; imm_use_iterator iter; Index: tree-ssa-copy.c =================================================================== --- tree-ssa-copy.c (revision 119245) +++ tree-ssa-copy.c (working copy) @@ -801,8 +801,10 @@ copy_prop_visit_phi_node (tree phi) Otherwise, this may move loop variant variables outside of their loops and prevent coalescing opportunities. If the value was loop invariant, it will be hoisted by LICM and - exposed for copy propagation. */ - if (loop_depth_of_name (arg) > loop_depth_of_name (lhs)) + exposed for copy propagation. We don't much about virtual + operands as they don't cause any LICM to happen. */ + if (loop_depth_of_name (arg) > loop_depth_of_name (lhs) + && is_gimple_reg (arg)) { phi_val.value = lhs; break;
Subject: Re: [4.3 Regression] [Linux] ICE in insert_into_preds_of_block On Mon, 2006-11-27 at 08:06 +0000, pinskia at gcc dot gnu dot org wrote: > > ------- Comment #11 from pinskia at gcc dot gnu dot org 2006-11-27 08:06 ------- > Here is the patch which fixes the PHI issue but I don't know if it will always > fix the PRE issue but I think it will as the PRE issue is always with VOPs: I am hiding a PRE bug but there is no reason for these PHIs to be there anyways as far as I can tell so I am still going to submit my patch for the PHIs but will keep this bug opened. Thanks, Andrew Pinski
*** Bug 30227 has been marked as a duplicate of this bug. ***
*** Bug 30244 has been marked as a duplicate of this bug. ***
Just a note here. My recent compilation of LAPACK with gfortran has stumbled onto to this bug. gfc -w -c -O3 -march=opteron -funroll-loops -ftree-vectorize \ -I/home/kargl/opt/modules sget33.f sget33.f: In function 'sget33': sget33.f:1: internal compiler error: in insert_into_preds_of_block, at tree-ssa-pre.c:2750 Please submit a full bug report,
Subject: Re: [4.3 Regression] [Linux] ICE in insert_into_preds_of_block I will try to get back to this bug this week. I was fighting some other fights last week, i apologize.
*** Bug 30441 has been marked as a duplicate of this bug. ***
*** Bug 30713 has been marked as a duplicate of this bug. ***
> I will try to get back to this bug this week. I was fighting some > other fights last week, i apologize. Danny, any update on this?
Uh, i think i accidentally fixed the reduced testcase with my recent alias patch (r122741). Are the others still failing?
(In reply to comment #20) > Uh, i think i accidentally fixed the reduced testcase with my recent alias > patch (r122741). > Are the others still failing? Yes, conf.i is still failing at -O2
Testcase based on conf.i: struct symbol { char *help; }; struct menu { struct menu *next; struct menu *list; struct symbol *sym; }; enum { ask_all, } input_mode = ask_all; static char line[128]; static char nohelp_text[] = ("Sorry, no help available for this option yet.\n"); conf_choice (struct menu *menu) { struct menu *child; while (1) { int cnt, def; conf_childs:for (child = menu->list; child; child = child->next) { if (!child->sym || !menu_is_visible (child)) if (!--cnt) break; } if (!child) continue; if (line[strlen (line) - 1] == '?') { printf ("\n%s\n", child->sym->help ? child->sym->help : ""); continue; } return 1; } }
the two test files from the LAPACK library dget33.f and sget33.f whose compilation with gfortran failed with -O3 optmisation are now compiled without error or warning. tested with gfortran 4.3 experimental (svn) dated 20070309 and 20070222
Subject: Bug 29922 Author: dberlin Date: Sat Mar 17 23:07:34 2007 New Revision: 123029 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123029 Log: 2007-03-16 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/29922 * tree-ssa-pre.c (bb_bitmap_sets): Remove RVUSE_* members. (get_representative): Removed. (value_dies_in_block_x): Update for rvuse removal. (valid_in_sets): Update for renaming of vuses_dies_in_block_x. (compute_antic_aux): Handle when PHI nodes appear in non-single-successors. (dump_bitmap_of_names): Removed. (compute_antic_safe): Renamed and removed rvuse calculation. Calculate only antic safe. (insert_into_preds_of_block): Remove assert. (execute_pre): Update for renamed functions. (defer_or_phi_translate_block): New function. Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/gcc.dg/tree-ssa/loadpre12.c trunk/gcc/tree-ssa-pre.c
Thanks, Danny!
Sorry for the delay. Fixed now.