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]

bootstrap broken


dies with

cc1: warnings being treated as errors
../../gcc/gcc/tree-vectorizer.c: In function 'vect_analyze_loop':
../../gcc/gcc/tree-vectorizer.c:4902: warning: 'tmp_dr' may be used uninitialized in this function
make[2]: *** [tree-vectorizer.o] Error 1

I attach this patch suggested by Andrew Pinski, which looks kind
of sensible to me too.  I took the opportunity to reforma the code
and avoid such long lines.

booting & testing on i686-pc-linux-gnu, ok if completes?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-11-30  Nathan Sidwell  <nathan@codesourcery.com>

	* tree-vectorizer.c (vect_analyze_data_refs): Reformat and avoid
	uninitialized variable.

Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.45
diff -c -3 -p -r2.45 tree-vectorizer.c
*** tree-vectorizer.c	30 Nov 2004 14:40:37 -0000	2.45
--- tree-vectorizer.c	30 Nov 2004 17:59:44 -0000
*************** vect_analyze_data_refs (loop_vec_info lo
*** 4899,4905 ****
    int nbbs = loop->num_nodes;
    block_stmt_iterator si;
    int j;
!   struct data_reference *dr, *tmp_dr;
    tree tag;
    tree address_base;
    bool base_aligned_p;
--- 4899,4905 ----
    int nbbs = loop->num_nodes;
    block_stmt_iterator si;
    int j;
!   struct data_reference *dr;
    tree tag;
    tree address_base;
    bool base_aligned_p;
*************** vect_analyze_data_refs (loop_vec_info lo
*** 5013,5029 ****
  	      switch (TREE_CODE (address_base))
  		{
  		case ARRAY_REF:
! 		  tmp_dr = analyze_array (stmt, TREE_OPERAND (symbl, 0), 
! 					  DR_IS_READ (tmp_dr));
! 		  tag = vect_get_base_and_bit_offset (tmp_dr, DR_BASE_NAME (tmp_dr), 
! 			   NULL_TREE, loop_vinfo, &offset, &base_aligned_p);
! 		  if (!tag)
! 		    {
! 		      if (vect_debug_stats (loop) || vect_debug_details (loop))
! 			fprintf (dump_file, "not vectorized: no memtag for ref.");
! 		      return false;
! 		    }
! 		  STMT_VINFO_MEMTAG (stmt_info) = tag; 
  		  break;
  		  
  		case VAR_DECL: 
--- 5013,5037 ----
  	      switch (TREE_CODE (address_base))
  		{
  		case ARRAY_REF:
! 		  {
! 		    struct data_reference *tmp_dr;
! 		    
! 		    tmp_dr = analyze_array (stmt, TREE_OPERAND (symbl, 0), 
! 					    DR_IS_READ (dr));
! 		    tag = vect_get_base_and_bit_offset
! 		      (tmp_dr, DR_BASE_NAME (tmp_dr), 
! 		       NULL_TREE, loop_vinfo, &offset, &base_aligned_p);
! 		    if (!tag)
! 		      {
! 			if (vect_debug_stats (loop)
! 			    || vect_debug_details (loop))
! 			  fprintf (dump_file,
! 				   "not vectorized: no memtag for ref.");
! 			return false;
! 		      }
! 		    STMT_VINFO_MEMTAG (stmt_info) = tag;
! 		  }
! 		  
  		  break;
  		  
  		case VAR_DECL: 

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