diff options
author | Gary Oblock <gary@amperecomputing.com> | 2021-01-29 12:49:07 -0800 |
---|---|---|
committer | Gary Oblock <gary@amperecomputing.com> | 2021-01-29 12:49:07 -0800 |
commit | 306d6c5c5ff7b724f96ec5489c87290aae8eee83 (patch) | |
tree | d28453f4ebb4a85767156d843d53a1e739642b63 | |
parent | f9144bc33b25fc55365169ca2d99c3677ec4db57 (diff) |
Mcf compiling to completion (it crashes at run time.)
-rw-r--r-- | gcc/ipa-str-reorg-instance-interleave.c | 8 | ||||
-rw-r--r-- | gcc/ipa-structure-reorg.c | 56 |
2 files changed, 31 insertions, 33 deletions
diff --git a/gcc/ipa-str-reorg-instance-interleave.c b/gcc/ipa-str-reorg-instance-interleave.c index 4ec4c94cbd2..653d1a2779d 100644 --- a/gcc/ipa-str-reorg-instance-interleave.c +++ b/gcc/ipa-str-reorg-instance-interleave.c @@ -2690,7 +2690,9 @@ new_element_assign_transformation ( gimple *stmt, ReorgType_t *ri, Info_t *info) } else { - temp_set = gimple_build_assign( field_val_temp, rhs); + // Changing this to a CONVERT_EXPR got Mcf to compile to + // completion (it, is crashing now instead of the compiler.) + temp_set = gimple_build_assign( field_val_temp, CONVERT_EXPR, rhs); SSA_NAME_DEF_STMT ( field_val_temp) = temp_set; } //SSA_NAME_DEF_STMT ( field_val_temp) = temp_set; @@ -2729,7 +2731,7 @@ new_element_assign_transformation ( gimple *stmt, ReorgType_t *ri, Info_t *info) tree op1type_type = TREE_TYPE ( op1type); temp_set = - gimple_build_assign( field_val_temp, rhs_ref); + gimple_build_assign( field_val_temp, rhs_ref); // <======== Here too? SSA_NAME_DEF_STMT ( field_val_temp) = temp_set; // lhs = temp @@ -2976,7 +2978,7 @@ new_make_transformed_ref ( tree ref_in, tree rhs_faa = build3 ( COMPONENT_REF, exposed_field_type, - base, // <<<===============!!!!! + base, base_field, NULL_TREE); diff --git a/gcc/ipa-structure-reorg.c b/gcc/ipa-structure-reorg.c index c5a82f9cabc..b01b8ebb3a0 100644 --- a/gcc/ipa-structure-reorg.c +++ b/gcc/ipa-structure-reorg.c @@ -3923,7 +3923,8 @@ contains_a_reorgtype ( gimple *stmt, Info *info) else { DEBUG_A("Not VOID.. looking it up\n"); - ReorgType_t *ret_val = get_reorgtype_info ( return_type, info ); + tree base = base_type_of ( return_type); + ReorgType_t *ret_val = get_reorgtype_info ( base, info ); //DEBUG_L(""); //wolf_fence ( info); @@ -4000,26 +4001,27 @@ function_return_type ( gimple *stmt, Info *info ) DEBUG_A( "function_return_type:> "); DEBUG_F ( print_gimple_stmt, stderr, stmt, 0); INDENT(2); - tree bt = void_type_node; // default to void + tree frt = void_type_node; // default to void // next line has issues but the mechanism is sound tree t = *gimple_call_lhs_ptr ( stmt); - //DEBUG_L(""); - //wolf_fence ( info); - DEBUG_A( "t %p\n", t); // Calls to a function returning void are skipped. if ( t != NULL ) { - DEBUG_A( "t: "); + DEBUG_A( "t = "); DEBUG_F( flexible_print, stderr, t, 1, (dump_flags_t)0); + tree type = TREE_TYPE( t); - DEBUG_A( "type: "); + DEBUG_A( "type = "); DEBUG_F( flexible_print, stderr, type, 1, (dump_flags_t)0); + //tree frt = base_type_of ( type); + frt = type; + DEBUG_A( "frt = "); + DEBUG_F( flexible_print, stderr, frt, 1, (dump_flags_t)0); tree bt = base_type_of ( type); - //DEBUG_L(""); - //wolf_fence ( info); + bool found = false; if ( TREE_CODE( bt) == VOID_TYPE ) { @@ -4031,59 +4033,53 @@ function_return_type ( gimple *stmt, Info *info ) // variable. tree ssa_name = gimple_call_lhs( stmt); - - //DEBUG_L(""); - //wolf_fence ( info); + DEBUG_A( "ssa_name = "); + DEBUG_F( flexible_print, stderr, ssa_name, 1, (dump_flags_t)0); gimple *use_stmt; imm_use_iterator iter; - int num_bt = 0; // future use FOR_EACH_IMM_USE_STMT ( use_stmt, iter, ssa_name) { + if ( found ) continue; DEBUG_A("use_stmt: "); DEBUG_F ( print_gimple_stmt, stderr, use_stmt, 0); - //DEBUG_L(""); - //wolf_fence ( info); if ( is_assign_from_ssa ( use_stmt ) ) { DEBUG_A("is assign from ssa\n"); tree lhs_assign = gimple_assign_lhs( use_stmt); - //DEBUG_L(""); - //wolf_fence ( info); + DEBUG_A( "lhs_assign = "); + DEBUG_F( flexible_print, stderr, lhs_assign, 1, (dump_flags_t)0); tree lhs_type = TREE_TYPE ( lhs_assign); - //DEBUG_L(""); - //wolf_fence ( info); + DEBUG_A( "lhs_type = "); + DEBUG_F( flexible_print, stderr, lhs_type, 1, (dump_flags_t)0); tree lhs_base_type = base_type_of ( lhs_type); DEBUG_A( "lhs_base_type = "); DEBUG_F( flexible_print, stderr, lhs_base_type, 1, (dump_flags_t)0); - //DEBUG_L(""); - //wolf_fence ( info); - //if ( TREE_CODE( lhs_base_type) != VOID_TYPE ) if ( !VOID_TYPE_P ( lhs_base_type) ) { DEBUG_A("not void\n"); INDENT(-2); - //DEBUG_L(""); - //wolf_fence ( info); - //return lhs_base_type; - num_bt++; - bt = lhs_base_type; + // Do not a return in a FOR_EACH_IMM_USE_STMT loop + frt = lhs_type; + DEBUG_A( "frt (from lhs_type) = "); + DEBUG_F( flexible_print, stderr, frt, 1, (dump_flags_t)0); + found = true; } } } } } INDENT(-2); - DEBUG_A( "bt = "); - DEBUG_F( flexible_print, stderr, bt, 1, (dump_flags_t)0); + DEBUG_A( "return frt = "); + DEBUG_F( flexible_print, stderr, frt, 1, (dump_flags_t)0); - return bt; + return frt; } bool |