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]

PATCH: Typo in fold_const.c



This patch fixes a typo in fold_const.c.  We were trying to cache
small integers, but failing because a TREE_TYPE is never INTEGER_CST.

Some day, we should actually make the tree system a good bit more
typesafe...

Tested on i686-pc-linux-gnu.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-01-02  Mark Mitchell  <mark@codesourcery.com>

	* fold-const.c (fold_convert): Fix typo.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.143
diff -c -p -r1.143 fold-const.c
*** fold-const.c	2000/12/19 01:17:20	1.143
--- fold-const.c	2001/01/02 23:59:22
*************** fold_convert (t, arg1)
*** 2020,2026 ****
  
  	  /* If we are trying to make a sizetype for a small integer, use
  	     size_int to pick up cached types to reduce duplicate nodes.  */
! 	  if (TREE_CODE (type) == INTEGER_CST && TYPE_IS_SIZETYPE (type)
  	      && compare_tree_int (arg1, 10000) < 0)
  	    return size_int_type_wide (TREE_INT_CST_LOW (arg1), type);
  
--- 2020,2026 ----
  
  	  /* If we are trying to make a sizetype for a small integer, use
  	     size_int to pick up cached types to reduce duplicate nodes.  */
! 	  if (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
  	      && compare_tree_int (arg1, 10000) < 0)
  	    return size_int_type_wide (TREE_INT_CST_LOW (arg1), type);
  

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