This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [assert] t*.c files


Nathan Sidwell wrote:

>> *************** free_temp_expr_table (temp_expr_table_p
>> *** 1279,1285 ****
>>     int x;
>>     for (x = 0; x <= num_var_partitions (t->map); x++)
>>       if (t->partition_dep_list[x] != NULL)
>> !       abort();
>>   #endif
>>
>>     while ((p = t->free_list))
>> --- 1281,1287 ----
>>     int x;
>>     for (x = 0; x <= num_var_partitions (t->map); x++)
>>       if (t->partition_dep_list[x] != NULL)
>> !       gcc_unreachable ();
>>   #endif
>>
>>     while ((p = t->free_list))

This needs gcc_assert.



>> *************** tree_gen_interval_profiler (histogram_va
>> *** 99,105 ****
>>       unsigned base ATTRIBUTE_UNUSED)
>>   {
>>     /* FIXME implement this.  */
>> !   abort ();
>>   }
>>
>>   /* Output instructions as GIMPLE trees to increment the power of
>> two histogram --- 99,108 ----
>>       unsigned base ATTRIBUTE_UNUSED)
>>   {
>>     /* FIXME implement this.  */
>> ! #ifdef ENABLE_CHECKING
>> !   internal_error ("unimplemented functionality");
>> ! #endif
>> !   gcc_unreachable ();
>>   }
>>
>>   /* Output instructions as GIMPLE trees to increment the power of
>> two histogram

I think these are better with sorry(), if you can describe what functionality
is missing.



>> *************** set_lattice_value (tree var, value val)
>> *** 209,240 ****
>>   {
>>     value *old = get_value (var);
>>
>> - #ifdef ENABLE_CHECKING
>>     if (val.lattice_val == UNDEFINED)
>>       {
>>         /* CONSTANT->UNDEFINED is never a valid state transition.  */
>> !       if (old->lattice_val == CONSTANT)
>> ! abort ();
>>
>>         /* UNKNOWN_VAL->UNDEFINED is never a valid state transition.
>> */ !       if (old->lattice_val == UNKNOWN_VAL)
>> ! abort ();
>>
>>         /* VARYING->UNDEFINED is generally not a valid state
>>   transition, except for values which are initialized to VARYING.  */
>> !       if (old->lattice_val == VARYING
>> !   && get_default_value (var).lattice_val != VARYING)
>> ! abort ();
>>       }
>>     else if (val.lattice_val == CONSTANT)
>> !     {
>> !       /* VARYING -> CONSTANT is an invalid state transition, except
>> ! for objects which start off in a VARYING state.  */
>> !       if (old->lattice_val == VARYING
>> !   && get_default_value (var).lattice_val != VARYING)
>> ! abort ();
>> !     }
>> ! #endif
>>
>>     /* If the constant for VAR has changed, then this VAR is really
>>     varying.  */ if (old->lattice_val == CONSTANT
>> --- 203,226 ----
>>   {
>>     value *old = get_value (var);
>>
>>     if (val.lattice_val == UNDEFINED)
>>       {
>>         /* CONSTANT->UNDEFINED is never a valid state transition.  */
>> !       gcc_assert (old->lattice_val != CONSTANT);
>>
>>         /* UNKNOWN_VAL->UNDEFINED is never a valid state transition.
>> */ !       gcc_assert (old->lattice_val != UNKNOWN_VAL);
>>
>>         /* VARYING->UNDEFINED is generally not a valid state
>>   transition, except for values which are initialized to VARYING.  */
>> !       gcc_assert (old->lattice_val != VARYING
>> !   || get_default_value (var).lattice_val == VARYING);
>>       }
>>     else if (val.lattice_val == CONSTANT)
>> !     /* VARYING -> CONSTANT is an invalid state transition, except
>> ! for objects which start off in a VARYING state.  */
>> !     gcc_assert (old->lattice_val == VARYING
>> ! || get_default_value (var).lattice_val != VARYING);
>>
>>     /* If the constant for VAR has changed, then this VAR is really
>>     varying.  */ if (old->lattice_val == CONSTANT


The last gcc_assert() is wrong, because the conditions were not inverted.



>> *************** vect_get_vec_def_for_operand (tree op, t
>> *** 948,954 ****
>>       {
>>         if (vect_debug_details (NULL))
>>   fprintf (dump_file, "reduction/induction - unsupported.");
>> !       abort (); /* FORNOW no support for reduction/induction.  */
>>       }
>>
>>
>> --- 925,931 ----
>>       {
>>         if (vect_debug_details (NULL))
>>   fprintf (dump_file, "reduction/induction - unsupported.");
>> !       internal_error ("no support for reduction/induction"); /*
>>       FORNOW */ }
>>
>>

sorry()?


>> *************** vect_get_vec_def_for_operand (tree op, t
>> *** 977,983 ****
>>             fprintf (dump_file, "unsupported defining stmt: ");
>>     print_generic_expr (dump_file, def_stmt, TDF_SLIM);
>>   }
>> !       abort ();
>>       }
>>
>>     /* Build a tree with vector elements. Create 'vec_inv =
>> {inv,inv,..,inv}'  */ --- 951,957 ----
>>             fprintf (dump_file, "unsupported defining stmt: ");
>>     print_generic_expr (dump_file, def_stmt, TDF_SLIM);
>>   }
>> !       internal_error ("unsupported defining stmt");
>>       }
>>
>>     /* Build a tree with vector elements. Create 'vec_inv =
>> {inv,inv,..,inv}'  */

sorry()?


Giovanni Bajo

>> *************** vect_finish_stmt_generation (tree stmt,
>> *** 1017,1026 ****
>>
>>     while (stmt != bsi_stmt (*bsi) && !bsi_end_p (*bsi))
>>       bsi_next (bsi);
>> ! #ifdef ENABLE_CHECKING
>> !   if (stmt != bsi_stmt (*bsi))
>> !     abort ();
>> ! #endif
>>   }
>>
>>
>> --- 991,997 ----
>>
>>     while (stmt != bsi_stmt (*bsi) && !bsi_end_p (*bsi))
>>       bsi_next (bsi);
>> !   gcc_assert (stmt == bsi_stmt (*bsi));
>>   }
>>
>>
>> *************** vect_transform_stmt (tree stmt, block_st
>> *** 1352,1384 ****
>>     bool is_store = false;
>>     tree vec_stmt = NULL_TREE;
>>     stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
>>
>>     switch (STMT_VINFO_TYPE (stmt_info))
>>       {
>>       case op_vec_info_type:
>> !       if (!vectorizable_operation (stmt, bsi, &vec_stmt))
>> !         abort ();
>>         break;
>>
>>       case assignment_vec_info_type:
>> !       if (!vectorizable_assignment (stmt, bsi, &vec_stmt))
>> ! abort ();
>>         break;
>>
>>       case load_vec_info_type:
>> !       if (!vectorizable_load (stmt, bsi, &vec_stmt))
>> ! abort ();
>>         break;
>>
>>       case store_vec_info_type:
>> !       if (!vectorizable_store (stmt, bsi, &vec_stmt))
>> ! abort ();
>>         is_store = true;
>>         break;
>>       default:
>>         if (vect_debug_details (NULL))
>>           fprintf (dump_file, "stmt not supported.");
>> !       abort ();
>>       }
>>
>>     STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
>> --- 1323,1356 ----
>>     bool is_store = false;
>>     tree vec_stmt = NULL_TREE;
>>     stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
>> +   bool done;
>>
>>     switch (STMT_VINFO_TYPE (stmt_info))
>>       {
>>       case op_vec_info_type:
>> !       done = vectorizable_operation (stmt, bsi, &vec_stmt);
>> !       gcc_assert (done);
>>         break;
>>
>>       case assignment_vec_info_type:
>> !       done = vectorizable_assignment (stmt, bsi, &vec_stmt);
>> !       gcc_assert (done);
>>         break;
>>
>>       case load_vec_info_type:
>> !       done = vectorizable_load (stmt, bsi, &vec_stmt);
>> !       gcc_assert (done);
>>         break;
>>
>>       case store_vec_info_type:
>> !       done = vectorizable_store (stmt, bsi, &vec_stmt);
>> !       gcc_assert (done);
>>         is_store = true;
>>         break;
>>       default:
>>         if (vect_debug_details (NULL))
>>           fprintf (dump_file, "stmt not supported.");
>> !       gcc_unreachable ();
>>       }
>>
>>     STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
>> *************** vect_transform_loop_bound (loop_vec_info
>> *** 1406,1432 ****
>>     tree cond;
>>     tree lb_type;
>>
>> ! #ifdef ENABLE_CHECKING
>> !   if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
>> !     abort ();
>> ! #endif
>>     old_N = LOOP_VINFO_NITERS (loop_vinfo);
>>     vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
>>
>> - #ifdef ENABLE_CHECKING
>>     /* FORNOW:
>>        assuming number-of-iterations divides by the vectorization
>> factor.  */ !   if (old_N % vf)
>> !     abort ();
>> ! #endif
>>
>>     orig_cond_expr = LOOP_VINFO_EXIT_COND (loop_vinfo);
>> ! #ifdef ENABLE_CHECKING
>> !   if (!orig_cond_expr)
>> !     abort ();
>> ! #endif
>> !   if (orig_cond_expr != bsi_stmt (loop_exit_bsi))
>> !     abort ();
>>
>>     create_iv (integer_zero_node, integer_one_node, NULL_TREE, loop,
>>        &loop_exit_bsi, false, &indx_before_incr, &indx_after_incr);
>> --- 1378,1394 ----
>>     tree cond;
>>     tree lb_type;
>>
>> !   gcc_assert (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo));
>>     old_N = LOOP_VINFO_NITERS (loop_vinfo);
>>     vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
>>
>>     /* FORNOW:
>>        assuming number-of-iterations divides by the vectorization
>> factor.  */ !   gcc_assert (!(old_N % vf));
>>
>>     orig_cond_expr = LOOP_VINFO_EXIT_COND (loop_vinfo);
>> !   gcc_assert (orig_cond_expr);
>> !   gcc_assert (orig_cond_expr == bsi_stmt (loop_exit_bsi));
>>
>>     create_iv (integer_zero_node, integer_one_node, NULL_TREE, loop,
>>        &loop_exit_bsi, false, &indx_before_incr, &indx_after_incr);
>> *************** vect_transform_loop_bound (loop_vec_info
>> *** 1434,1441 ****
>>     /* bsi_insert is using BSI_NEW_STMT. We need to bump it back
>>        to point to the exit condition.  */
>>     bsi_next (&loop_exit_bsi);
>> !   if (bsi_stmt (loop_exit_bsi) != orig_cond_expr)
>> !     abort ();
>>
>>     /* new loop exit test:  */
>>     lb_type = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (orig_cond_expr,
>> 0), 1)); --- 1396,1402 ----
>>     /* bsi_insert is using BSI_NEW_STMT. We need to bump it back
>>        to point to the exit condition.  */
>>     bsi_next (&loop_exit_bsi);
>> !   gcc_assert (bsi_stmt (loop_exit_bsi) == orig_cond_expr);
>>
>>     /* new loop exit test:  */
>>     lb_type = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (orig_cond_expr,
>> 0), 1));
>> *************** vect_transform_loop (loop_vec_info loop_
>> *** 1484,1492 ****
>>     /* 1) Make sure the loop header has exactly two entries
>>        2) Make sure we have a preheader basic block.  */
>>
>> !   if (!loop->header->pred->pred_next
>> !       || loop->header->pred->pred_next->pred_next)
>> !     abort ();
>>
>>     loop_split_edge_with (loop_preheader_edge (loop), NULL);
>>
>> --- 1445,1452 ----
>>     /* 1) Make sure the loop header has exactly two entries
>>        2) Make sure we have a preheader basic block.  */
>>
>> !   gcc_assert (loop->header->pred->pred_next);
>> !   gcc_assert (!loop->header->pred->pred_next->pred_next);
>>
>>     loop_split_edge_with (loop_preheader_edge (loop), NULL);
>>
>> *************** vect_transform_loop (loop_vec_info loop_
>> *** 1515,1524 ****
>>         print_generic_expr (dump_file, stmt, TDF_SLIM);
>>       }
>>     stmt_info = vinfo_for_stmt (stmt);
>> ! #ifdef ENABLE_CHECKING
>> !   if (!stmt_info)
>> !     abort ();
>> ! #endif
>>     if (!STMT_VINFO_RELEVANT_P (stmt_info))
>>       {
>>         bsi_next (&si);
>> --- 1475,1481 ----
>>         print_generic_expr (dump_file, stmt, TDF_SLIM);
>>       }
>>     stmt_info = vinfo_for_stmt (stmt);
>> !   gcc_assert (stmt_info);
>>     if (!STMT_VINFO_RELEVANT_P (stmt_info))
>>       {
>>         bsi_next (&si);
>> *************** vect_transform_loop (loop_vec_info loop_
>> *** 1528,1535 ****
>>     /* FORNOW: Verify that all stmts operate on the same number of
>>                units and no inner unrolling is necessary.  */
>>     vectype = STMT_VINFO_VECTYPE (stmt_info);
>> !   if (GET_MODE_NUNITS (TYPE_MODE (vectype)) !=
>> vectorization_factor) !     abort ();
>>   #endif
>>     /* -------- vectorize statement ------------ */
>>     if (vect_debug_details (NULL))
>> --- 1485,1492 ----
>>     /* FORNOW: Verify that all stmts operate on the same number of
>>                units and no inner unrolling is necessary.  */
>>     vectype = STMT_VINFO_VECTYPE (stmt_info);
>> !   gcc_assert (GET_MODE_NUNITS (TYPE_MODE (vectype))
>> !       == vectorization_factor);
>>   #endif
>>     /* -------- vectorize statement ------------ */
>>     if (vect_debug_details (NULL))
>> *************** vect_analyze_operations (loop_vec_info l
>> *** 1668,1677 ****
>>         fprintf (dump_file, "==> examining statement: ");
>>         print_generic_expr (dump_file, stmt, TDF_SLIM);
>>       }
>> ! #ifdef ENABLE_CHECKING
>> !   if (!stmt_info)
>> !     abort ();
>> ! #endif
>>     /* skip stmts which do not need to be vectorized.
>>        this is expected to include:
>>        - the COND_EXPR which is the loop exit condition
>> --- 1625,1633 ----
>>         fprintf (dump_file, "==> examining statement: ");
>>         print_generic_expr (dump_file, stmt, TDF_SLIM);
>>       }
>> !
>> !   gcc_assert (stmt_info);
>> !
>>     /* skip stmts which do not need to be vectorized.
>>        this is expected to include:
>>        - the COND_EXPR which is the loop exit condition
>> Index: tree-vn.c
>> ===================================================================
>> RCS file: /cvs/gcc/gcc/gcc/tree-vn.c,v
>> retrieving revision 2.4
>> diff -c -3 -p -r2.4 tree-vn.c
>> *** tree-vn.c 10 Aug 2004 17:57:41 -0000 2.4
>> --- tree-vn.c 9 Sep 2004 07:41:56 -0000
>> *************** vn_compute (tree expr, hashval_t val, vu
>> *** 87,100 ****
>>   {
>>     size_t i;
>>
>> - #if defined ENABLE_CHECKING
>>     /* EXPR must not be a statement.  We are only interested in value
>>        numbering expressions on the RHS of assignments.  */
>> !   if (expr == NULL_TREE
>> !       || (expr->common.ann
>> !   && expr->common.ann->common.type == STMT_ANN))
>> !     abort ();
>> ! #endif
>>
>>     val = iterative_hash_expr (expr, val);
>>
>> --- 87,97 ----
>>   {
>>     size_t i;
>>
>>     /* EXPR must not be a statement.  We are only interested in value
>>        numbering expressions on the RHS of assignments.  */
>> !   gcc_assert (expr);
>> !   gcc_assert (!expr->common.ann
>> !       || expr->common.ann->common.type != STMT_ANN);
>>
>>     val = iterative_hash_expr (expr, val);
>>
>> *************** set_value_handle (tree e, tree v)
>> *** 177,187 ****
>>       SSA_NAME_VALUE (e) = v;
>>     else if (EXPR_P (e) || DECL_P (e))
>>       get_tree_ann (e)->common.value_handle = v;
>> -   else if (is_gimple_min_invariant (e))
>> -     /* Do nothing.  Constants are their own value handles.  */
>> -     ;
>>     else
>> !     abort ();
>>   }
>>
>>
>> --- 174,182 ----
>>       SSA_NAME_VALUE (e) = v;
>>     else if (EXPR_P (e) || DECL_P (e))
>>       get_tree_ann (e)->common.value_handle = v;
>>     else
>> !     /* Do nothing.  Constants are their own value handles.  */
>> !     gcc_assert (is_gimple_min_invariant (e));
>>   }
>>
>>
>> *************** get_value_handle (tree expr)
>> *** 284,293 ****
>>         tree_ann_t ann = tree_ann (expr);
>>         return ((ann) ? ann->common.value_handle : NULL_TREE);
>>       }
>> !   else if (is_gimple_min_invariant (expr))
>> !     return expr;
>> !
>> !   abort ();
>>   }
>>
>>
>> --- 279,289 ----
>>         tree_ann_t ann = tree_ann (expr);
>>         return ((ann) ? ann->common.value_handle : NULL_TREE);
>>       }
>> !   else
>> !     {
>> !       gcc_assert (is_gimple_min_invariant (expr));
>> !       return expr;
>> !     }
>>   }
>>
>>
>> Index: Makefile.in
>> ===================================================================
>> RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
>> retrieving revision 1.1378
>> diff -c -3 -p -r1.1378 Makefile.in
>> *** Makefile.in 8 Sep 2004 15:28:55 -0000 1.1378
>> --- Makefile.in 9 Sep 2004 07:48:54 -0000
>> *************** tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $
>> *** 1700,1706 ****
>>      tree-alias-common.h convert.h $(TM_H) coretypes.h langhooks.h \
>>      $(TREE_DUMP_H) tree-pass.h params.h
>>   tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H)
>> $(CONFIG_H) \ !    $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(GGC_H)
>>      diagnostic.h \ tree-inline.h $(FLAGS_H) function.h $(TM_H)
>>   $(TIMEVAR_H) tree-pass.h tree-eh.o : tree-eh.c $(TREE_FLOW_H)
>>      $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H)
>> function.h except.h langhooks.h \ --- 1700,1706 ----
>>      tree-alias-common.h convert.h $(TM_H) coretypes.h langhooks.h \
>>      $(TREE_DUMP_H) tree-pass.h params.h
>>   tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H)
>> $(CONFIG_H) \ !    $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(GGC_H)
>>      diagnostic.h errors.h \ tree-inline.h $(FLAGS_H) function.h
>>   $(TM_H) $(TIMEVAR_H) tree-pass.h tree-eh.o : tree-eh.c
>>      $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H)
>> $(TM_H) $(FLAGS_H) function.h except.h langhooks.h \

Giovanni Bajo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]