From 053836b03165034db2c87a9d331d4d8ab4dd2d1a Mon Sep 17 00:00:00 2001 From: Gary Oblock Date: Tue, 12 Jan 2021 13:37:54 -0800 Subject: Another type modification related bug fix. --- gcc/ipa-str-reorg-instance-interleave.c | 122 ++++++++++++++++----- gcc/ipa-structure-reorg.c | 187 +++++++++++++++++++++++--------- gcc/ipa-structure-reorg.h | 4 +- 3 files changed, 228 insertions(+), 85 deletions(-) diff --git a/gcc/ipa-str-reorg-instance-interleave.c b/gcc/ipa-str-reorg-instance-interleave.c index 7f4c147c795..7b8e35540f2 100644 --- a/gcc/ipa-str-reorg-instance-interleave.c +++ b/gcc/ipa-str-reorg-instance-interleave.c @@ -138,6 +138,7 @@ static basic_block make_bb ( char *, basic_block); int str_reorg_instance_interleave_qual ( Info *info) { + DEBUG_A("str_reorg_instance_interleave_qual:>\n"); // this is the qualification code for instance interleaving // str_reorg_instance_interleave_qual_part ( info); @@ -152,6 +153,7 @@ str_reorg_instance_interleave_qual ( Info *info) int str_reorg_instance_interleave_trans ( Info *info) { + DEBUG_A("str_reorg_instance_interleave_trans:>\n"); if ( BYPASS_TRANSFORM ) { @@ -161,8 +163,9 @@ str_reorg_instance_interleave_trans ( Info *info) if ( info->show_all_reorg_cands ) { - fprintf ( info->reorg_dump_file, "Start of str_reorg_instance_interleave_trans:\n"); - print_program ( info->reorg_dump_file, PRINT_FORMAT, false, 4, info); + print_program ( info->reorg_dump_file, + "Start of str_reorg_instance_interleave_trans", + PRINT_FORMAT, false, 4, info); } //DEBUG ("INTERNALS PRINT\n"); @@ -2081,16 +2084,14 @@ str_reorg_instance_interleave_trans ( Info *info) pop_cfun (); } - DEBUG_L("After bulk of transformations\n"); + DEBUG_F ( print_program, info->reorg_dump_file, + "After bulk of transformations", + PRINT_FORMAT, false, 4, info); - DEBUG_F( print_program, info->reorg_dump_file, PRINT_FORMAT, false, 4, info); - - DEBUG ("INTERNALS PRINT\n"); - #if 0 - DEBUG_F (apply_to_all_gimple, print_internals, true, (void *)info); - #else - print_program ( stderr, true, true, 0, info); - #endif + // With internals + DEBUG_F ( print_program, stderr, + "After bulk of transformations", + true, true, 0, info); // Experiment... Seems OK modify_global_declarations ( info); @@ -2457,17 +2458,19 @@ str_reorg_instance_interleave_trans ( Info *info) // This used to be off of.. "if ( info->show_all_reorg_cands ) { ..." // I'm leaning towards deleting this as redundnt. - //DEBUG ( info->reorg_dump_file, - // "\nEnd of str_reorg_instance_interleave_trans (after mini-psasses):\n\n"); - //DEBUG_F ( print_program, info->reorg_dump_file, PRINT_FORMAT, false, 4, info); + //DEBUG_F ( print_program, info->reorg_dump_file, + // "End of str_reorg_instance_interleave_trans (after mini-psasses)", + // PRINT_FORMAT, false, 4, info); // TBD Should this be a diagnostic or not? - DEBUG ("INTERNALS PRINT\n"); - #if 0 - DEBUG_F (apply_to_all_gimple, print_internals, true, (void *)info); - #else - print_program ( stderr, true, true, 0, info); - #endif + DEBUG_F ( print_program, stderr, + "At end of str_reorg_instance_interleave_trans" + PRINT_FORMAT, false, 0, info); + + // With internals + DEBUG_F ( print_program, stderr, + "At end of str_reorg_instance_interleave_trans" + true, false, 0, info); // NOTE, spinning through all the functions and recomputing all the // dominace info here is a really bad idea. @@ -2677,6 +2680,16 @@ new_element_assign_transformation ( gimple *stmt, ReorgType_t *ri, Info_t *info) new_make_transformed_ref ( ro_side, ri, &ref_expr, &ref_seq, &field_val_temp, ro_on_left ? lhs_mod : rhs_mod, info); + + // TBD What is ref_expr? + DEBUG_A(" All about ref_expr!\n"); + INDENT(2); + DEBUG_A("print it... "); + DEBUG_F(flexible_print, stderr, ref_expr, 1, (dump_flags_t)0); + DEBUG_A("its type... "); + DEBUG_F(flexible_print, stderr, TREE_TYPE(ref_expr), 1, (dump_flags_t)0); + + INDENT(-2); gimple *temp_set; gimple *middle_set; @@ -2804,6 +2817,7 @@ make_transformed_ref ( tree ref_in, tree *field_val_temp, Info_t *info ) { + DEBUG_A("make_transformed_ref:>\n"); // For deeply nested case we need the lowest. tree lowest_comp_ref = find_deepest_comp_ref ( ref_in); gcc_assert ( lowest_comp_ref); @@ -3152,9 +3166,9 @@ new_make_transformed_ref ( tree ref_in, tree find_deepest_comp_ref ( tree comp_ref_expr ) { - //DEBUG_A("find_deepest_comp_ref:> of "); - //DEBUG_F(flexible_print, stderr, comp_ref_expr, 2, (dump_flags_t)0); - //DEBUG("tree code of %s\n", code_str( TREE_CODE(comp_ref_expr))); + DEBUG_A("find_deepest_comp_ref:> of "); + DEBUG_F(flexible_print, stderr, comp_ref_expr, 2, (dump_flags_t)0); + DEBUG("tree code of %s\n", code_str( TREE_CODE(comp_ref_expr))); //INDENT(2); enum tree_code code = TREE_CODE ( comp_ref_expr); @@ -3229,7 +3243,7 @@ create_deep_ref_aux ( tree ref_in, if ( inner_op0_code == MEM_REF ) { // TBD print: inner_op0, inner_op1, inner_op0_op0, inner_op0_op1, - tree inner_op1 = TREE_OPERAND( ref_in, 1);; + tree inner_op1 = TREE_OPERAND( ref_in, 1); tree inner_op0_op0 = TREE_OPERAND( inner_op0, 0); tree inner_op0_op0_type = TREE_TYPE ( inner_op0_op0); tree inner_op0_op1 = TREE_OPERAND( inner_op0, 1); @@ -3334,10 +3348,52 @@ create_deep_ref_aux ( tree ref_in, false, #endif info); + DEBUG_A("ref_type = "); + DEBUG_F(flexible_print, stderr, ref_type, 1, (dump_flags_t)0); + DEBUG_A("to = "); + DEBUG_F(flexible_print, stderr, to, 1, (dump_flags_t)0); + *lower_type_to = to; *lower_type_from = to ? ref_type : NULL; - INDENT(-2); - return ref_in; + + // Note, at this time ref_in has the correct type. No! + // TBD so how did the gimple show the wrong type!? It didn't! + // Build a new ref! + tree inner_op1 = TREE_OPERAND( ref_in, 1); + + DEBUG_A("inner_op0 = "); + DEBUG_F(flexible_print, stderr, inner_op0, 1, (dump_flags_t)0); + DEBUG_A("inner_op1 = "); + DEBUG_F(flexible_print, stderr, inner_op1, 1, (dump_flags_t)0); + + // Find if it needs a type modification + tree var_type = TREE_TYPE(inner_op0); + DEBUG_A("var_type = "); + DEBUG_F(flexible_print, stderr, var_type, 1, (dump_flags_t)0); + tree modified_var_type = find_modified ( var_type, false, info); + if ( modified_var_type != NULL ) + { + tree new_ref; + tree new_field = find_coresponding_field ( modified_var_type, inner_op1); + + // Technically new_field isn't an element of inner_op0 but + // modify_global_declarations should fix that... Hopefully. + new_ref = + build3 ( COMPONENT_REF, + field_type, + inner_op0, + new_field, + NULL_TREE); + + INDENT(-2); + return new_ref; + + } + else + { + INDENT(-2); + return ref_in; + } } else if ( top_code == COMPONENT_REF ) { @@ -3622,6 +3678,7 @@ print_internals (gimple *stmt, void *data) static void str_reorg_instance_interleave_qual_part ( Info *info) { + DEBUG_A("str_reorg_instance_interleave_qual_part:>\n"); // TBD save the return value so we can bypass further // instance interleaving if none of it is profitable. reorg_perf_qual ( info); @@ -3630,6 +3687,7 @@ str_reorg_instance_interleave_qual_part ( Info *info) static void str_reorg_instance_interleave_type_part ( Info *info) { + DEBUG_A("str_reorg_instance_interleave_type_part:>\n"); #if 0 create_new_types ( info); #endif @@ -4657,10 +4715,10 @@ is_array_access( tree acc) static void account_for_access ( tree access, tree field, std::vector *acc_info, Info_t *info) { - //DEBUG_A("account_for_use var: "); - //DEBUG_F(flexible_print, stderr, access, 0, (dump_flags_t)0); - //DEBUG(", field: "); - //DEBUG_F(flexible_print, stderr, field, 1, (dump_flags_t)0); + DEBUG_A("account_for_access:> var "); + DEBUG_F(flexible_print, stderr, access, 0, (dump_flags_t)0); + DEBUG(", field: "); + DEBUG_F(flexible_print, stderr, field, 1, (dump_flags_t)0); // assert might eventually make sense but not yet //gcc_assert ( TREE_CODE ( ssa_var) == SSA_NAME); @@ -5474,6 +5532,10 @@ make_bb ( char *msg, basic_block prev_bb ) return ret; } + +// Degugging functions called from other parts of +// gcc as an easier way of getting at interesting debug +// code. void sneak_tree ( tree x) { diff --git a/gcc/ipa-structure-reorg.c b/gcc/ipa-structure-reorg.c index 6950dbe9d53..f3338e5ea0c 100644 --- a/gcc/ipa-structure-reorg.c +++ b/gcc/ipa-structure-reorg.c @@ -283,7 +283,7 @@ initial_debug_info ( Info *info) { if ( info->reorg_dump_file ) { - print_program ( info->reorg_dump_file, PRINT_FORMAT, false, 0, info); + print_program ( info->reorg_dump_file, "Initial State", PRINT_FORMAT, false, 0, info); } } @@ -292,7 +292,7 @@ final_debug_info ( Info *info) { if ( info->reorg_dump_file ) { - print_program ( info->reorg_dump_file, PRINT_FORMAT, false, 0, info); + print_program ( info->reorg_dump_file, "Final State", PRINT_FORMAT, false, 0, info); } } @@ -563,7 +563,7 @@ reorg_analysis_debug ( Info *info, ReorgType *reorg ) static bool find_decls_and_types ( Info *info) { - //DEBUG_L("find_decls_and_types:> entered\n"); + DEBUG_L("find_decls_and_types:> entered\n"); detected_incompatible_syntax = false; std::map whitelisted = get_whitelisted_nodes(); @@ -776,6 +776,7 @@ find_decls_and_types ( Info *info) //DEBUG_F( print_progdecl, stderr, 2, &decl_info); } } + if ( info->show_all_reorg_cands_in_detail ) { @@ -800,7 +801,7 @@ find_decls_and_types ( Info *info) static bool find_decls_and_types ( Info *info) { - //DEBUG_L("find_decls_and_types:> entered\n"); + DEBUG_L("find_decls_and_types:> entered\n"); // Don't keep any structure types if they aren't // used in an array or have a pointer type (which @@ -1094,6 +1095,7 @@ find_all_record_types ( std::map *types, tree type, Info_t *in static void find_all_record_types ( tree type, Info_t *info) { + DEBUG_A("find_all_record_types:>\n"); std::map *types = info->type_mod_info; // Get cannonical form of record type tree base = base_type_of ( type); @@ -1119,7 +1121,7 @@ find_and_create_all_modified_types ( Info_t *info) { std::map *types = info->type_mod_info; std::deque rec_types_work_list; - //DEBUG_L("find_and_create_all_modified_types:>\n"); + DEBUG_L("find_and_create_all_modified_types:>\n"); //DEBUG_A("At start:\n"); //DEBUG_F( dump_modified_types, stderr, false, info); @@ -1482,13 +1484,17 @@ find_and_create_all_modified_types ( Info_t *info) static std::vector::iterator find_in_type_vec ( std::vector *types, tree type) { - INDENT(2); + //INDENT(2); for ( auto looki = types->begin (); looki != types->end (); looki++) { tree look = *looki; - if ( same_type_p ( look, type) ) return looki; + if ( same_type_p ( look, type) ) + { + //INDENT(-2); + return looki; + } } - INDENT(-2); + //INDENT(-2); return types->end (); } @@ -1764,8 +1770,8 @@ find_modified ( tree type, #endif Info_t *info ) { - DEBUG_A("find_modified:> "); - DEBUG_F(flexible_print, stderr, type, 1, (dump_flags_t)0); + //DEBUG_A("find_modified:> "); + //DEBUG_F(flexible_print, stderr, type, 1, (dump_flags_t)0); // Use canonical type tree canonical = TYPE_MAIN_VARIANT ( base_type_of ( type)); tree ret_val = NULL; @@ -1794,8 +1800,8 @@ find_modified ( tree type, } #endif - DEBUG_A(" returns... "); - DEBUG_F(flexible_print, stderr, ret_val, 1, (dump_flags_t)0); + //DEBUG_A(" returns... "); + //DEBUG_F(flexible_print, stderr, ret_val, 1, (dump_flags_t)0); return ret_val; } @@ -1863,8 +1869,8 @@ contains_a_modified ( gimple *stmt, #endif Info_t *info ) { - //DEBUG_A("contains_a_modified:> "); - //DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); + DEBUG_A("contains_a_modified:> "); + DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); // For an assign check both sides component refs. if ( gimple_code ( stmt) == GIMPLE_ASSIGN ) { @@ -1952,7 +1958,7 @@ disqualify_struct_in_struct_or_union ( Info *info) varpool_node *var; std::set typeset; - //DEBUG_L( "disqualify_struct_in_struct_or_union:>\n"); + DEBUG_L( "disqualify_struct_in_struct_or_union:>\n"); //INDENT(2); FOR_EACH_VARIABLE ( var) @@ -2038,7 +2044,7 @@ disq_str_in_str_or_union_helper ( tree type, std::set *typeset, Info *info ) { - //DEBUG_L( "disq_str_in_str_or_union_helper:> (possibele deletes)\n"); + DEBUG_L( "disq_str_in_str_or_union_helper:> (possibele deletes)\n"); //INDENT(2); if ( typeset->find ( type) != typeset->end ()) return; @@ -2123,6 +2129,7 @@ Info::is_non_escaping_set_empty() bool transformation_legality ( Info *info) { + DEBUG_A("transformation_legality:>\n"); //TODO: Gary, for my purposes, I need to start running the // code related to dead field eliminate. So, I'll add this bit // @@ -2269,12 +2276,30 @@ modify_global_declarations ( Info *info) // lend themselves to any necessary reorg transformation. // Note, it's possible to preserve them, if that makes sense, // in remove_unreferenced_decls. + #if 0 std::vector::iterator pv; for ( pv = info->prog_decl->begin (); pv != info->prog_decl->end (); pv++ ) { modify_decl_core ( &( pv->gcc_decl), info); } + #else + // The prog_decls are obsolete + varpool_node *var; + FOR_EACH_VARIABLE ( var) + { + tree decl = var->decl; + tree type = base_type_of ( decl); + + bool do_reorg = + TREE_CODE ( type ) == RECORD_TYPE && get_reorgtype_info ( type, info) != NULL; + bool do_modify = find_modified ( type, false, info) != NULL; + if ( do_reorg || do_modify ) + { + modify_decl_core ( &decl, info); + } + } + #endif // NOTE, Call modufy_decl_core breaks hello world! @@ -2347,7 +2372,7 @@ modify_global_declarations ( Info *info) static void disqualify_all_reorgtypes_of ( gimple *stmt, int num, Info *info) { - //DEBUG_L("disqualify %d reorgtypes of:> ", num); + DEBUG_L("disqualify %d reorgtypes of:> ", num); //DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); if ( info->show_all_reorg_cands_in_detail ) { @@ -2389,6 +2414,7 @@ adjust_result_decl ( struct function *func) static tree modify_func_type ( struct function *func, Info *info ) { + DEBUG_A("modify_func_type:>\n"); tree func_type = TREE_TYPE ( func->decl); //DEBUG_L("old func_type = "); //DEBUG_F( flexible_print, stderr, func_type, 1, (dump_flags_t)0); @@ -2488,6 +2514,7 @@ modify_func_type ( struct function *func, Info *info ) static bool needs_modification_p ( struct function *func, Info *info ) { + DEBUG_A("needs_modification_p:>\n"); tree func_type = TREE_TYPE ( func->decl); tree ret_type = TREE_TYPE ( func_type); tree base = base_type_of ( ret_type); @@ -2603,7 +2630,7 @@ make_multilevel ( tree base_type, int levels_indirection) static bool modify_func_decl_core ( struct function *func, Info *info) { - //DEBUG_L("modify_func_decl_core:>\n"); + DEBUG_L("modify_func_decl_core:>\n"); //INDENT(4); //DEBUG_A("func->decl = %p, ", func->decl); //DEBUG_F( flexible_print, stderr, func->decl, 1, (dump_flags_t)0); @@ -2664,36 +2691,59 @@ modify_func_decl_core ( struct function *func, Info *info) return true; } +void +xxx( tree x ) +{ + DEBUG_A("XXX decl = "); + DEBUG_F( flexible_print, stderr, x, 1, (dump_flags_t)0); + if ( TREE_CODE ( x) == PARM_DECL ) + { + DEBUG_A("XXX decl_arg_type = "); + DEBUG_F( flexible_print, stderr, DECL_ARG_TYPE(x), 1, (dump_flags_t)0); + } +} + // Returns true if a modification occurred bool modify_decl_core ( tree *location, Info *info) { DEBUG_A("modify_decl_core:> "); DEBUG_F( flexible_print, stderr, *location, 1, (dump_flags_t)0); - INDENT(2); - + INDENT(4); + + tree decl = *location; tree type = TREE_TYPE ( *location); - DEBUG_A("type = "); - DEBUG_F( flexible_print, stderr, type, 0, (dump_flags_t)0); + DEBUG_A("OLD:\n"); + DEBUG_A(" decl = "); + DEBUG_F( flexible_print, stderr, decl, 1, (dump_flags_t)0); + if ( TREE_CODE ( decl) == PARM_DECL ) + { + DEBUG_A(" decl_arg_type = "); + DEBUG_F( flexible_print, stderr, DECL_ARG_TYPE(decl), 1, (dump_flags_t)0); + } + + //DEBUG_A("type = "); + //DEBUG_F( flexible_print, stderr, type, 0, (dump_flags_t)0); tree base = base_type_of ( type); - DEBUG(", base = "); - DEBUG_F( flexible_print, stderr, base, 1, (dump_flags_t)0); + //DEBUG(", base = "); + //DEBUG_F( flexible_print, stderr, base, 1, (dump_flags_t)0); - #if 1 // Look for a modified type tree modified_to = find_modified ( base, #if ALLOW_REVERSE false, #endif info); - DEBUG_A(", modified_to = "); - DEBUG_F( flexible_print, stderr, modified_to, 1, (dump_flags_t)0); + tree mtv_modified_to = + modified_to == NULL ? NULL : TYPE_MAIN_VARIANT ( modified_to); + //DEBUG_A("Before Modify_Decl_Core\n"); + //DEBUG_A(" modified_to = "); + //DEBUG_F( flexible_print, stderr, modified_to, 1, (dump_flags_t)0); bool use_mod = false; - #endif ReorgType_t *ri = get_reorgtype_info ( base, info); if ( ri == NULL ) @@ -2702,20 +2752,22 @@ modify_decl_core ( tree *location, Info *info) if( !use_mod ) { DEBUG_A( "!use_mod && ri == NULL... return\n"); - INDENT(-2); + INDENT(-4); return false; } } tree prev_type; int levels = number_of_levels ( type); + //DEBUG_A( "levels = %d\n", levels); + DEBUG_A("Modify TREE_TYPE\n"); if ( use_mod ) { - DEBUG_A( "use_mod %s\n", levels == 0 ? "&& levels == 0" : ""); + //DEBUG_A( " use_mod \n"); if ( levels == 0 ) { - TREE_TYPE(*location) = TYPE_MAIN_VARIANT ( modified_to); + TREE_TYPE(*location) = mtv_modified_to; } else { @@ -2724,6 +2776,7 @@ modify_decl_core ( tree *location, Info *info) } else { + //DEBUG_A( " !use_mod \n"); // TBD, I have some doubt that this actually works right for more // that one level... It's not that make_multilevel is wrong, it's // that it seems like it will build one too many levels because @@ -2733,45 +2786,68 @@ modify_decl_core ( tree *location, Info *info) // Fakes this for levels == 1 if ( levels == 0) { - DEBUG_A("Not a pointer, don't modify it!\n"); + DEBUG_A(" Not a pointer, don't modify it!\n"); return false; } // This also happens with other similar uses of make_multilevel. if ( levels == 1) { - DEBUG_A( "LEVEL ONE\n"); + //DEBUG_A( " LEVEL ONE\n"); gcc_assert ( TYPE_MAIN_VARIANT ( ri->pointer_rep)); TREE_TYPE(*location) = TYPE_MAIN_VARIANT ( ri->pointer_rep); } else { - DEBUG_L( "LEVEL > ONE\n"); - TREE_TYPE(*location) = make_multilevel ( ri->pointer_rep, levels); + //DEBUG_L( " LEVEL > ONE\n"); + TREE_TYPE(*location) = make_multilevel ( ri->pointer_rep, levels -1); // changed here } } + //DEBUG_A("Modify DECL_INITIAL\n"); + /// TBD !!! Add levels to this! // I'm not sure what this does! if ( use_mod ) { + //DEBUG_A( " use_mod \n"); if ( DECL_INITIAL ( *location) != NULL ) { - DECL_INITIAL ( *location) = TYPE_MAIN_VARIANT ( modified_to); + if ( levels == 0 ) + { + DECL_INITIAL ( *location) = mtv_modified_to; + } + else + { + DECL_INITIAL ( *location) = + make_multilevel ( mtv_modified_to, levels); + } } } else if ( DECL_INITIAL ( *location) != NULL ) { - // Note this assumes the levels code above is not general - DECL_INITIAL ( *location) = TYPE_MAIN_VARIANT ( ri->pointer_rep); + //DEBUG_A( " !use_mod \n"); + if ( levels == 1 ) + { + DECL_INITIAL ( *location) = TYPE_MAIN_VARIANT ( ri->pointer_rep); + } + else + { + DECL_INITIAL ( *location) = + make_multilevel ( ri->pointer_rep, levels -1); // changed here + } } relayout_decl ( *location); - DEBUG_L(" after modify_decl_core"); - DEBUG_F( print_generic_decl, stderr, *location, (dump_flags_t)0); - DEBUG("\n"); - - INDENT(-2); + DEBUG_A("NEW:\n"); + DEBUG_A(" decl = "); + DEBUG_F( flexible_print, stderr, *location, 1, (dump_flags_t)0); + if ( TREE_CODE ( *location) == PARM_DECL ) + { + DEBUG_A(" decl_arg_type = "); + DEBUG_F( flexible_print, stderr, DECL_ARG_TYPE(*location), 1, (dump_flags_t)0); + } + INDENT(-4); return true; } @@ -3152,7 +3228,7 @@ reorg_forbidden ( gimple *stmt, Info *info ) void remove_deleted_types ( Info *info, char *where, ReorgFn reorg_fn) { - //DEBUG_LA( "remove_deleted_types:> %d to delete of %d types\n", info->num_deleted, info->reorg_type->size ()); + DEBUG_LA( "remove_deleted_types:> %d to delete of %d types\n", info->num_deleted, info->reorg_type->size ()); if ( info->show_delete ) { fprintf ( info->reorg_dump_file, "DELETING REORG TYPES (%s):\n", where); @@ -3519,7 +3595,7 @@ recognize_op ( tree op, bool lie, Info *info) tree multilevel_component_ref ( tree op) { - //DEBUG_A("multilevel_component_ref:> "); + DEBUG_A("multilevel_component_ref:> "); //DEBUG_F(flexible_print, stderr, op, 1, (dump_flags_t)0); //INDENT(2); tree inner_op0 = TREE_OPERAND( op, 0); @@ -3529,7 +3605,7 @@ multilevel_component_ref ( tree op) if ( inner_op0_code == COMPONENT_REF || inner_op0_code == ARRAY_REF ) { tree ret = multilevel_component_ref ( inner_op0); - INDENT(-2); + //INDENT(-2); return ret; } else @@ -3758,6 +3834,7 @@ struct hidden_info { static tree detect_reorg ( tree *tp, int *dummy, void *data) { + //DEBUG_A("detect_reorg:>\n"); struct walk_stmt_info *walk_data = ( struct walk_stmt_info *)data; hidden_info_t *hi = ( hidden_info_t *)walk_data->info; //DEBUG_L( "*tp = "); @@ -3776,7 +3853,7 @@ detect_reorg ( tree *tp, int *dummy, void *data) ReorgType_t * contains_a_reorgtype ( gimple *stmt, Info *info) { - //DEBUG_L ( "contains_a_reorgtype:> "); + DEBUG_L ( "contains_a_reorgtype:> "); //DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); //INDENT(2); @@ -3805,6 +3882,7 @@ contains_a_reorgtype ( gimple *stmt, Info *info) static tree detect_reorg_in_expr ( tree *tp, int *w_s, void *data) { + //DEBUG_A("detect_reorg_in_expr:>\n"); //DEBUG_L("*tp = "); //DEBUG_F( flexible_print, stderr, *tp, 1, (dump_flags_t)0); hidden_info_t *tre_hi = ( hidden_info_t *)data; @@ -4017,10 +4095,13 @@ print_progdecl ( FILE *file, int leading_space, ProgDecl_t *progdecl ) } void -print_program ( FILE *file, bool my_format, bool internal, int leading_space, Info_t *info) +print_program ( FILE *file, char *msg, bool my_format, bool internal, int leading_space, Info_t *info) { struct cgraph_node *node; - fprintf ( file, "%*sProgram:\n", leading_space, ""); + fprintf ( file, "%*s%s%s%s%s:\n", + leading_space, "", + my_format && internal ? "Program-with-internals" : "Program", + msg ? " (" : "", msg ? msg : "", msg ? ")" : ""); // Print Global Decls // @@ -4156,8 +4237,8 @@ print_function ( FILE *file, ReorgType_t * get_reorgtype( gimple *stmt, Info *info, int i) { - //DEBUG_A("get_reorgtype:> i = %d, stmt = ", i); - //DEBUG_F(print_gimple_stmt, stderr, stmt, 0); + DEBUG_A("get_reorgtype:> i = %d, stmt = ", i); + DEBUG_F(print_gimple_stmt, stderr, stmt, 0); // Looking at operands of statement, when we get to // the ith one, return it. int num_reorgs = 0; @@ -4206,8 +4287,8 @@ get_reorgtype( gimple *stmt, Info *info, int i) int num_reorgtypes( gimple *stmt, Info *info) { - //DEBUG_LA("num_reorgtypes:> "); - //DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); + DEBUG_LA("num_reorgtypes:> "); + DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); // Looking at operands of statement, count // the number that have reorg types. // Note, they may be (most likely are) the same as other diff --git a/gcc/ipa-structure-reorg.h b/gcc/ipa-structure-reorg.h index ef12d4f8c25..1b4f9718d07 100644 --- a/gcc/ipa-structure-reorg.h +++ b/gcc/ipa-structure-reorg.h @@ -305,7 +305,7 @@ extern bool is_reorg_type ( tree, Info_t *); extern tree base_type_of ( tree); extern tree base_type_with_levels ( tree, int *); extern void print_reorg ( FILE *, int, ReorgType_t *); -extern void print_program ( FILE *, bool, bool, int, Info_t *); +extern void print_program ( FILE *, char *, bool, bool, int, Info_t *); extern void print_type ( FILE *, tree); extern void modify_ssa_name_type ( tree, tree); extern bool print_internals (gimple *, void *); @@ -317,7 +317,7 @@ extern bool is_assign_from_ssa ( gimple *); // I have no intention of leaving these debugging marcos or uses of // them in the code. However, some of the uses should obviously be -// converted to dump file information.0 +// converted to dump file information. #define DEBUGGING 0 #if DEBUGGING enum Display { -- cgit v1.2.3