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]

Another uninitialized cleanup patch



Two patches - one to fix a ChangeLog typo, and the other to clean up 
uninitialized variables are enclosed.

First, the ChangeLog patch to fix a typo:

*** ChangeLog.bak       Sat May  8 05:05:34 1999
--- ChangeLog   Sat May  8 05:05:43 1999
*************** Mon Apr 26 00:26:18 1999  Richard Hender
*** 411,417 ****
  Mon Apr 26 01:08:36 1999  Toshiyasu Morita  (tm@netcom.com)
  
        * fold-const.c (make_range): Always initialize arg0 and arg1.
!       (fold): Simlarly for alt0 and alt1.
        * function.c (fixup_var_refs_insns): Initialize insn_list.
        (instantiate_virtual_regs_1): Initialize offset.
        * optabs.c (expand_binop): Initialize carry_in, carry_out, op0_xhigh
--- 411,417 ----
  Mon Apr 26 01:08:36 1999  Toshiyasu Morita  (tm@netcom.com)
  
        * fold-const.c (make_range): Always initialize arg0 and arg1.
!       (fold): Similarly for alt0 and alt1.
        * function.c (fixup_var_refs_insns): Initialize insn_list.
        (instantiate_virtual_regs_1): Initialize offset.
        * optabs.c (expand_binop): Initialize carry_in, carry_out, op0_xhigh

This next patch cleans up most of the remaining uninitialized variables in 
gcc. There are a few more enums which should be initialized, though.
Hopefully this ChangeLog entry is in the correct format (sorry Jeff):

Sat May  8 04:45:29 1999 Toshiyasu Morita  (tm@netcom.com)

	* combine.c (try_combine): Initialize i2_code_number and
	other_code_number
	(find_split_point): Initialize pos, unsignedp, and inner.
	(simplify_if_then_else): Initialize op and c1.
	* cse.c (cse_insn): Initialize src_eqv_volatile, src_eqv_in_memory,
	src_eqv_in_struct, src_eqv_hash, and sets.
	* dbxout.c (dbxout_block): Initialize blocknum.
	* genopinit.c (gen_insn): Initialize m1, m2, and op.
	* local-alloc.c (block_alloc): Initialize r1.
	* loop.c (move_movables): Initialize first.
	(strength_reduce): Initialize increment.
	(recombine_givs): Initialize life_start and life_end.
	(check_dbra_loop): Initialize comparison_val.
	(load_mems): Initialize end_label.
	* reg-stack.c (record_asm_reg_life): Initialize clobber_reg.
	(subst_asm_stack_regs): Initialize clobber_loc.
	(convert_regs): Initialize insn.
	* regmove.c (fixup_match_1): Initialize insn_const, dst_note, and set2.
	* reload.c (decompose): Initialize base and initialize offset properly.
	(find_reloads): Initialize goal_alternative_number and
        goal_earlyclobber.
	* sched.c (schedule_block): Initialize regs_sometimes_live and
	sometimes_max.
	* stmt.c (expand_end_case): Initialize range.
	* unroll.c (unroll_loop): Initialize local_label.
	(copy_loop_body): Initialize copy.
	* varasm.c (assemble_variable): Initialize size_tree.
	(output_constructor): Initialize byte.

*** combine.c.bak	Sat May  8 04:21:27 1999
--- combine.c	Sat May  8 04:23:13 1999
*************** try_combine (i3, i2, i1)
*** 1338,1344 ****
    /* Nonzero is I2's body now appears in I3.  */
    int i2_is_used;
    /* INSN_CODEs for new I3, new I2, and user of condition code.  */
!   int insn_code_number, i2_code_number, other_code_number;
    /* Contains I3 if the destination of I3 is used in its source, which means
       that the old life of I3 is being killed.  If that usage is placed into
       I2 and not in I3, a REG_DEAD note must be made.  */
--- 1338,1344 ----
    /* Nonzero is I2's body now appears in I3.  */
    int i2_is_used;
    /* INSN_CODEs for new I3, new I2, and user of condition code.  */
!   int insn_code_number, i2_code_number = 0, other_code_number = 0;
    /* Contains I3 if the destination of I3 is used in its source, which means
       that the old life of I3 is being killed.  If that usage is placed into
       I2 and not in I3, a REG_DEAD note must be made.  */
*************** find_split_point (loc, insn)
*** 2592,2599 ****
    rtx x = *loc;
    enum rtx_code code = GET_CODE (x);
    rtx *split;
!   int len = 0, pos, unsignedp;
!   rtx inner;
  
    /* First special-case some codes.  */
    switch (code)
--- 2592,2599 ----
    rtx x = *loc;
    enum rtx_code code = GET_CODE (x);
    rtx *split;
!   int len = 0, pos = 0, unsignedp = 0;
!   rtx inner = NULL_RTX;
  
    /* First special-case some codes.  */
    switch (code)
*************** simplify_if_then_else (x)
*** 4456,4464 ****
        rtx f = make_compound_operation (false, SET);
        rtx cond_op0 = XEXP (cond, 0);
        rtx cond_op1 = XEXP (cond, 1);
!       enum rtx_code op, extend_op = NIL;
        enum machine_mode m = mode;
!       rtx z = 0, c1;
  
        if ((GET_CODE (t) == PLUS || GET_CODE (t) == MINUS
  	   || GET_CODE (t) == IOR || GET_CODE (t) == XOR
--- 4456,4464 ----
        rtx f = make_compound_operation (false, SET);
        rtx cond_op0 = XEXP (cond, 0);
        rtx cond_op1 = XEXP (cond, 1);
!       enum rtx_code op = NIL, extend_op = NIL;
        enum machine_mode m = mode;
!       rtx z = 0, c1 = NULL_RTX;
  
        if ((GET_CODE (t) == PLUS || GET_CODE (t) == MINUS
  	   || GET_CODE (t) == IOR || GET_CODE (t) == XOR
*** cse.c.bak	Sat May  8 03:35:59 1999
--- cse.c	Sat May  8 03:36:34 1999
*************** cse_insn (insn, libcall_insn)
*** 6436,6447 ****
  
    rtx src_eqv = 0;
    struct table_elt *src_eqv_elt = 0;
!   int src_eqv_volatile;
!   int src_eqv_in_memory;
!   int src_eqv_in_struct;
!   unsigned src_eqv_hash;
  
!   struct set *sets;
  
    this_insn = insn;
  
--- 6436,6447 ----
  
    rtx src_eqv = 0;
    struct table_elt *src_eqv_elt = 0;
!   int src_eqv_volatile = 0;
!   int src_eqv_in_memory = 0;
!   int src_eqv_in_struct = 0;
!   unsigned src_eqv_hash = 0;
  
!   struct set *sets = 0;
  
    this_insn = insn;
  
*** dbxout.c.bak	Sat May  8 03:35:00 1999
--- dbxout.c	Sat May  8 03:35:16 1999
*************** dbxout_block (block, depth, args)
*** 2572,2578 ****
       int depth;
       tree args;
  {
!   int blocknum;
  
    while (block)
      {
--- 2572,2578 ----
       int depth;
       tree args;
  {
!   int blocknum = 0;
  
    while (block)
      {
*** genopinit.c.bak	Sat May  8 04:28:34 1999
--- genopinit.c	Sat May  8 04:28:42 1999
*************** gen_insn (insn)
*** 131,137 ****
       rtx insn;
  {
    char *name = XSTR (insn, 0);
!   int m1, m2, op;
    size_t pindex;
    int i;
    const char *np, *pp, *p, *q;
--- 131,137 ----
       rtx insn;
  {
    char *name = XSTR (insn, 0);
!   int m1 = 0, m2 = 0, op = 0;
    size_t pindex;
    int i;
    const char *np, *pp, *p, *q;
*** local-alloc.c.bak	Sat May  8 04:24:47 1999
--- local-alloc.c	Sat May  8 04:24:57 1999
*************** block_alloc (b)
*** 1079,1085 ****
  	{
  	  register rtx link, set;
  	  register int win = 0;
! 	  register rtx r0, r1;
  	  int combined_regno = -1;
  	  int i;
  
--- 1079,1085 ----
  	{
  	  register rtx link, set;
  	  register int win = 0;
! 	  register rtx r0, r1 = NULL_RTX;
  	  int combined_regno = -1;
  	  int i;
  
*** loop.c.bak	Sat May  8 03:37:09 1999
--- loop.c	Sat May  8 03:38:24 1999
*************** move_movables (movables, threshold, insn
*** 1837,1843 ****
  	    {
  	      int count;
  	      register struct movable *m1;
! 	      rtx first;
  
  	      /* Now move the insns that set the reg.  */
  
--- 1837,1843 ----
  	    {
  	      int count;
  	      register struct movable *m1;
! 	      rtx first = NULL_RTX;
  
  	      /* Now move the insns that set the reg.  */
  
*************** strength_reduce (scan_start, end, loop_t
*** 3984,3990 ****
        else
  	{
  	  struct iv_class *bl2 = 0;
! 	  rtx increment;
  
  	  /* Biv initial value is not a simple move.  If it is the sum of
  	     another biv and a constant, check if both bivs are incremented
--- 3984,3990 ----
        else
  	{
  	  struct iv_class *bl2 = 0;
! 	  rtx increment = NULL_RTX;
  
  	  /* Biv initial value is not a simple move.  If it is the sum of
  	     another biv and a constant, check if both bivs are incremented
*************** recombine_givs (bl, loop_start, loop_end
*** 7355,7361 ****
       LAST_GIV.  */
    for (i = giv_count - 1; i >= 0; i = rescan)
      {
!       int life_start, life_end;
  
        for (last_giv = 0, rescan = -1; i >= 0; i--)
  	{
--- 7355,7361 ----
       LAST_GIV.  */
    for (i = giv_count - 1; i >= 0; i = rescan)
      {
!       int life_start = 0, life_end = 0;
  
        for (last_giv = 0, rescan = -1; i >= 0; i--)
  	{
*************** check_dbra_loop (loop_end, insn_count, l
*** 7813,7819 ****
  		  || (GET_CODE (comparison) == LE
  		      && no_use_except_counting)))
  	    {
! 	      HOST_WIDE_INT add_val, add_adjust, comparison_val;
  	      rtx initial_value, comparison_value;
  	      int nonneg = 0;
  	      enum rtx_code cmp_code;
--- 7813,7819 ----
  		  || (GET_CODE (comparison) == LE
  		      && no_use_except_counting)))
  	    {
! 	      HOST_WIDE_INT add_val, add_adjust, comparison_val = 0;
  	      rtx initial_value, comparison_value;
  	      int nonneg = 0;
  	      enum rtx_code cmp_code;
*************** load_mems (scan_start, end, loop_top, st
*** 9390,9396 ****
    int i;
    rtx p;
    rtx label = NULL_RTX;
!   rtx end_label;
  
    if (loop_mems_idx > 0) 
      {
--- 9390,9396 ----
    int i;
    rtx p;
    rtx label = NULL_RTX;
!   rtx end_label = NULL_RTX;
  
    if (loop_mems_idx > 0) 
      {
*** reg-stack.c.bak	Sat May  8 04:27:58 1999
--- reg-stack.c	Sat May  8 04:28:22 1999
*************** record_asm_reg_life (insn, regstack)
*** 694,700 ****
    int implicitly_dies[FIRST_PSEUDO_REGISTER];
    int alt;
  
!   rtx *clobber_reg;
    int n_inputs, n_outputs;
  
    /* Find out what the constraints require.  If no constraint
--- 694,700 ----
    int implicitly_dies[FIRST_PSEUDO_REGISTER];
    int alt;
  
!   rtx *clobber_reg = 0;
    int n_inputs, n_outputs;
  
    /* Find out what the constraints require.  If no constraint
*************** subst_asm_stack_regs (insn, regstack)
*** 2205,2211 ****
    enum reg_note *note_kind;	/* The type of each note */
  
    rtx *clobber_reg;
!   rtx **clobber_loc;
  
    struct stack_def temp_stack;
    int n_notes;
--- 2205,2211 ----
    enum reg_note *note_kind;	/* The type of each note */
  
    rtx *clobber_reg;
!   rtx **clobber_loc = 0;
  
    struct stack_def temp_stack;
    int n_notes;
*************** static void
*** 2804,2810 ****
  convert_regs ()
  {
    register int block, reg;
!   register rtx insn, next;
    struct stack_def regstack;
  
    for (block = 0; block < blocks; block++)
--- 2804,2810 ----
  convert_regs ()
  {
    register int block, reg;
!   register rtx insn = NULL_RTX, next;
    struct stack_def regstack;
  
    for (block = 0; block < blocks; block++)
*** regmove.c.bak	Sat May  8 04:23:28 1999
--- regmove.c	Sat May  8 04:24:29 1999
*************** fixup_match_1 (insn, set, src, src_subre
*** 1658,1666 ****
    int success = 0;
    int num_calls = 0, s_num_calls = 0;
    enum rtx_code code = NOTE;
!   HOST_WIDE_INT insn_const, newconst;
    rtx overlap = 0; /* need to move insn ? */
!   rtx src_note = find_reg_note (insn, REG_DEAD, src), dst_note;
    int length, s_length, true_loop_depth;
  
    if (! src_note)
--- 1658,1666 ----
    int success = 0;
    int num_calls = 0, s_num_calls = 0;
    enum rtx_code code = NOTE;
!   HOST_WIDE_INT insn_const = 0, newconst;
    rtx overlap = 0; /* need to move insn ? */
!   rtx src_note = find_reg_note (insn, REG_DEAD, src), dst_note = NULL_RTX;
    int length, s_length, true_loop_depth;
  
    if (! src_note)
*************** fixup_match_1 (insn, set, src, src_subre
*** 1917,1923 ****
    if (! overlap && (code == PLUS || code == MINUS))
      {
        rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
!       rtx q, set2;
        int num_calls2 = 0, s_length2 = 0;
  
        if (note && CONSTANT_P (XEXP (note, 0)))
--- 1917,1923 ----
    if (! overlap && (code == PLUS || code == MINUS))
      {
        rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
!       rtx q, set2 = NULL_RTX;
        int num_calls2 = 0, s_length2 = 0;
  
        if (note && CONSTANT_P (XEXP (note, 0)))
*** reload.c.bak	Sat May  8 04:25:14 1999
--- reload.c	Sat May  8 04:26:08 1999
*************** decompose (x)
*** 2215,2221 ****
    val.base = 0;
    if (GET_CODE (x) == MEM)
      {
!       rtx base, offset = 0;
        rtx addr = XEXP (x, 0);
  
        if (GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC
--- 2215,2221 ----
    val.base = 0;
    if (GET_CODE (x) == MEM)
      {
!       rtx base = NULL_RTX, offset = NULL_RTX;
        rtx addr = XEXP (x, 0);
  
        if (GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC
*************** find_reloads (insn, replace, ind_levels,
*** 2443,2449 ****
    int swapped;
    int goal_alternative[MAX_RECOG_OPERANDS];
    int this_alternative_number;
!   int goal_alternative_number;
    int operand_reloadnum[MAX_RECOG_OPERANDS];
    int goal_alternative_matches[MAX_RECOG_OPERANDS];
    int goal_alternative_matched[MAX_RECOG_OPERANDS];
--- 2443,2449 ----
    int swapped;
    int goal_alternative[MAX_RECOG_OPERANDS];
    int this_alternative_number;
!   int goal_alternative_number = 0;
    int operand_reloadnum[MAX_RECOG_OPERANDS];
    int goal_alternative_matches[MAX_RECOG_OPERANDS];
    int goal_alternative_matched[MAX_RECOG_OPERANDS];
*************** find_reloads (insn, replace, ind_levels,
*** 2458,2464 ****
    rtx substed_operand[MAX_RECOG_OPERANDS];
    rtx body = PATTERN (insn);
    rtx set = single_set (insn);
!   int goal_earlyclobber, this_earlyclobber;
    enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
    int retval = 0;
    /* Cache the last regno for the last pseudo we did an output reload
--- 2458,2464 ----
    rtx substed_operand[MAX_RECOG_OPERANDS];
    rtx body = PATTERN (insn);
    rtx set = single_set (insn);
!   int goal_earlyclobber = 0, this_earlyclobber;
    enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
    int retval = 0;
    /* Cache the last regno for the last pseudo we did an output reload
*** sched.c.bak	Sat May  8 04:27:12 1999
--- sched.c	Sat May  8 04:27:28 1999
*************** schedule_block (b, file)
*** 2625,2632 ****
    rtx prev_head;
  
    /* Keep life information accurate.  */
!   register struct sometimes *regs_sometimes_live;
!   int sometimes_max;
  
    if (file)
      fprintf (file, ";;\t -- basic block number %d from %d to %d --\n",
--- 2625,2632 ----
    rtx prev_head;
  
    /* Keep life information accurate.  */
!   register struct sometimes *regs_sometimes_live = 0;
!   int sometimes_max = 0;
  
    if (file)
      fprintf (file, ";;\t -- basic block number %d from %d to %d --\n",
*** stmt.c.bak	Sat May  8 03:32:04 1999
--- stmt.c	Sat May  8 03:32:18 1999
*************** void
*** 5037,5043 ****
  expand_end_case (orig_index)
       tree orig_index;
  {
!   tree minval = NULL_TREE, maxval = NULL_TREE, range, orig_minval;
    rtx default_label = 0;
    register struct case_node *n;
    unsigned int count;
--- 5037,5043 ----
  expand_end_case (orig_index)
       tree orig_index;
  {
!   tree minval = NULL_TREE, maxval = NULL_TREE, range = NULL_TREE, orig_minval;
    rtx default_label = 0;
    register struct case_node *n;
    unsigned int count;
*** unroll.c.bak	Sat May  8 03:38:32 1999
--- unroll.c	Sat May  8 03:39:17 1999
*************** unroll_loop (loop_end, insn_count, loop_
*** 236,242 ****
    int max_labelno, max_insnno;
    rtx insert_before;
    struct inline_remap *map;
!   char *local_label;
    char *local_regno;
    int max_local_regnum;
    int maxregnum;
--- 236,242 ----
    int max_labelno, max_insnno;
    rtx insert_before;
    struct inline_remap *map;
!   char *local_label = 0;
    char *local_regno;
    int max_local_regnum;
    int maxregnum;
*************** copy_loop_body (copy_start, copy_end, ma
*** 1654,1660 ****
       rtx start_label, loop_end, insert_before, copy_notes_from;
  {
    rtx insn, pattern;
!   rtx set, tem, copy;
    int dest_reg_was_split, i;
  #ifdef HAVE_cc0
    rtx cc0_insn = 0;
--- 1654,1660 ----
       rtx start_label, loop_end, insert_before, copy_notes_from;
  {
    rtx insn, pattern;
!   rtx set, tem, copy = NULL_RTX;
    int dest_reg_was_split, i;
  #ifdef HAVE_cc0
    rtx cc0_insn = 0;
*** varasm.c.bak	Sat May  8 03:33:57 1999
--- varasm.c	Sat May  8 03:34:39 1999
*************** assemble_variable (decl, top_level, at_e
*** 1157,1163 ****
  {
    register char *name;
    unsigned int align;
!   tree size_tree;
    int reloc = 0;
    enum in_section saved_in_section;
  
--- 1157,1163 ----
  {
    register char *name;
    unsigned int align;
!   tree size_tree = NULL_TREE;
    int reloc = 0;
    enum in_section saved_in_section;
  
*************** output_constructor (exp, size)
*** 3997,4003 ****
    int total_bytes = 0;
    /* Non-zero means BYTE contains part of a byte, to be output.  */
    int byte_buffer_in_use = 0;
!   register int byte;
  
    if (HOST_BITS_PER_WIDE_INT < BITS_PER_UNIT)
      abort ();
--- 3997,4003 ----
    int total_bytes = 0;
    /* Non-zero means BYTE contains part of a byte, to be output.  */
    int byte_buffer_in_use = 0;
!   register int byte = 0;
  
    if (HOST_BITS_PER_WIDE_INT < BITS_PER_UNIT)
      abort ();


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