This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[Java] Clean-up TREE_OVERFLOW usage in the Java front-end


This patch is a repost of the java front-end bits of my previous patch
http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02412.html to clean-up
the use of TREE_OVERFLOW in the compiler.  Currently, TREE_OVERFLOW
is only ever set for constant class tree codes, such as INTEGER_CST.
By restricting the testing of TREE_OVERFLOW to the appropriate tree
nodes, we can introduce stricter checking in the middle-end.


The following patch has been tested on i686-pc-linux-gnu with a
full "make bootstrap", all default languages, and regression tested
with a top-level "make -k check" with no new failures.

Ok for mainline?


2005-06-08  Roger Sayle  <roger@eyesopen.com>

	* typeck.c (convert): Only clear TREE_OVERFLOW on INTEGER_CST nodes.


Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/typeck.c,v
retrieving revision 1.77
diff -c -3 -p -r1.77 typeck.c
*** typeck.c	6 Mar 2005 12:57:57 -0000	1.77
--- typeck.c	8 Jun 2005 04:09:09 -0000
*************** convert (tree type, tree expr)
*** 142,148 ****
  	     overflows in a narrowing integer conversion, but Java
  	     doesn't care.  */
  	  tree tmp = fold (convert_to_integer (type, expr));
! 	  TREE_OVERFLOW (tmp) = 0;
  	  return tmp;
  	}
      }
--- 142,149 ----
  	     overflows in a narrowing integer conversion, but Java
  	     doesn't care.  */
  	  tree tmp = fold (convert_to_integer (type, expr));
! 	  if (TREE_CODE (tmp) == INTEGER_CST)
! 	    TREE_OVERFLOW (tmp) = 0;
  	  return tmp;
  	}
      }

Roger
--


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