safe_from_p changes tree code

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Sun Jun 28 21:43:00 GMT 1998


A recent change in safe_from_p broke --enable-checking; an error mark
is now accessed as an expression. This patch introduces a new access
macro.

Martin

Sat Jun 27 12:57:05 1998  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* tree.c (ERROR_MARK_OPERAND): New macro.
	* expr.c (safe_from_p): Use it.


Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.77
diff -c -p -r1.77 expr.c
*** expr.c	1998/06/25 15:14:26	1.77
--- expr.c	1998/06/29 04:25:00
*************** safe_from_p (x, exp, top_p)
*** 4858,4865 ****
  
  	  nops = tree_code_length[(int) SAVE_EXPR];
  	  for (i = 0; i < nops; i++)
! 	    if (TREE_OPERAND (exp, i) != 0
! 		&& ! safe_from_p (x, TREE_OPERAND (exp, i), 0))
  	      return 0;
  	  return 1;
  
--- 4858,4865 ----
  
  	  nops = tree_code_length[(int) SAVE_EXPR];
  	  for (i = 0; i < nops; i++)
! 	    if (ERROR_MARK_OPERAND (exp, i) != 0
! 		&& ! safe_from_p (x, ERROR_MARK_OPERAND (exp, i), 0))
  	      return 0;
  	  return 1;
  
Index: tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.h,v
retrieving revision 1.42
diff -c -p -r1.42 tree.h
*** tree.h	1998/06/25 15:14:18	1.42
--- tree.h	1998/06/29 04:25:23
*************** struct tree_vec
*** 678,683 ****
--- 678,686 ----
  #define TREE_OPERAND(NODE, I) (EXPR_CHECK (NODE)->exp.operands[I])
  #define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
  
+ /* In expression that has been turned into ERROR_MARK. */
+ #define ERROR_MARK_OPERAND(NODE, I) (ERROR_MARK_CHECK (NODE)->exp.operands[I])
+ 
  /* In expression with file location information.  */
  #define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0)
  #define EXPR_WFL_FILENAME(NODE) (IDENTIFIER_POINTER ((NODE)->common.chain))




More information about the Gcc-patches mailing list