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]

Fw: PATCH: Fix c-common's use of c-tree.h



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


Your message was not delivered successfully.

Reason:
imput: can't open mail-aliases file: /home/mitchell/.im/Aliases, ignored.
imput: can't open host-aliases file: /home/mitchell/.hostaliases, ignored.
imput: message accepted.
imput: NNTP disabled (header format is not fit).
imput: ERROR: No recipients collected.
imput: opening smtp session to localhost(25).
imput: >>> 220 dumbledore.codesourcery.com ESMTP Sendmail 8.9.3/8.8.7; Thu, 29 Jun 2000 17:35:26 -0700
imput: <<< EHLO localhost
imput: >>> 250-dumbledore.codesourcery.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
imput: >>> 250-EXPN
imput: >>> 250-VERB
imput: >>> 250-8BITMIME
imput: >>> 250-SIZE
imput: >>> 250-DSN
imput: >>> 250-ONEX
imput: >>> 250-ETRN
imput: >>> 250-XUSR
imput: >>> 250 HELP
imput: <<< MAIL FROM:<>
imput: >>> 250 <>... Sender ok
imput: <<< RCPT TO:<mitchell@codesourcery.com>
imput: >>> 250 <mitchell@codesourcery.com>... Recipient ok
imput: <<< DATA
imput: >>> 354 Enter mail, end with "." on a line by itself



I noticed that c-common.h included c-tree.h and c-lex.h.  This is
bogus since c-tree.h and c-lex.c are C-specific; they are not shared
with C++.  So, I moved the stuff in those headers that really was
common into c-common.h, where it belongs.  Then, I removed the
equivalent declarations from cp/cp-tree.h.  Amusing was that the cp
subdirectory declared build_binary_op with one fewer argument than
c-common.c was expecting.  This works OK with most ABIs, but is still
pretty dang weird.

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

2000-06-29  Mark Mitchell  <mark@codesourcery.com>

	* c-common.c: Include c-common.h, not c-lex.h or c-tree.h.
	* c-common.h (flag_const_strings): Declare.
	(warn_format): Likewise.
	(flag_traditional): Likewise.
	(flag_isoc99): Likewise.
	(warn_parentheses): Likewise.
	(warn_conversion): Likewise.
	(C_TYPE_OBJECT_P): Likewise.
	(C_TYPE_INCOMPLETE_P): Likewise.
	(C_TYPE_FUNCTION_P): Likewise.
	(C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise.
	(C_EXP_ORIGINAL_CODE): Likewise.
	(build_unary_op): Likewise.
	(build_binary_op): Likewise.
	(lvalue_p): Likewise.
	(default_conversion): Likewise.
	(common_type): Likewise.
	* c-tree.h (C_TYPE_OBJECT_P): Remove.
	(C_TYPE_INCOMPLETE_P): Likewise.
	(C_TYPE_FUNCTION_P): Likewise.
	(C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise.
	(C_EXP_ORIGINAL_CODE): Likewise.
	(common_type): Likewise.
	(default_conversion): Likewise.
	(build_binary_op): Likewise.
	(build_unary_op): Likewise.
	(lvalue_p): Likewise.
	(flag_const_strings): Likewise.
	(warn_format): Likewise.
	(warn_conversion): Likewise.
	(flag_traditional): Likewise.
	(flag_isoc99): Likewise.
	(warn_parentheses): Likewise.

2000-06-29  Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (flag_const_strings): Remove.
	(warn_parentheses): Likewise.
	(warn_format): Likewise.
	(common_type): Likewise.
	(default_conversion): Likewise.
	(build_binary_op): Likewise.
	(cp_build_binary_op): New macro.
	* call.c (build_new_op): Use cp_build_binary_op instead of
	build_binary_op.
	* class.c (build_vtable_entry_ref): Likewise.
	* decl.c (expand_static_init): Likewise.
	(compute_array_index_type): Likewise.
	(build_enumerator): Likewise.
	* decl2.c (delete_sanity): Likewise.
	(start_static_initialization_or_destruction): Likewise.
	* error.c (dump_type_suffix): Likewise.
	* init.c (resolve_offset_ref): Likewise.
	(build_new): Likewise.
	(build_new_1): Likewise.
	(build_vec_delete_1): Likewise.
	(build_vec_init): Likewise.
	(build_delete): Likewise.
	* rtti.c (synthesize_tinfo_fn): Likewise.
	(synthesize_tinfo_var): Likewise.
	* search.c (expand_upcast_fixups): Likewise.
	(fixup_all_virtual_upcast_offsets): Likewise.
	* typeck.c (build_array_ref): Likewise.
	(get_member_function_from_ptrfunc): Likewise.
	(build_binary_op): Add parameter.
	(pointer_int_sum): Use cp_build_binary_op.
	(pointer_diff): Likewise.
	(build_modify_expr): Likewise.
	(get_delta_difference): Likewise.
	(build_ptrmemfunc): Likewise.
	
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.c,v
retrieving revision 1.121
diff -c -p -r1.121 c-common.c
*** c-common.c	2000/06/25 17:27:27	1.121
--- c-common.c	2000/06/29 23:21:16
*************** Boston, MA 02111-1307, USA.  */
*** 22,29 ****
  #include "config.h"
  #include "system.h"
  #include "tree.h"
! #include "c-lex.h"
! #include "c-tree.h"
  #include "flags.h"
  #include "toplev.h"
  #include "output.h"
--- 22,28 ----
  #include "config.h"
  #include "system.h"
  #include "tree.h"
! #include "c-common.h"
  #include "flags.h"
  #include "toplev.h"
  #include "output.h"
Index: c-common.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.h,v
retrieving revision 1.18
diff -c -p -r1.18 c-common.h
*** c-common.h	2000/06/19 18:40:19	1.18
--- c-common.h	2000/06/29 23:21:17
*************** enum c_tree_index
*** 54,74 ****
      CTI_MAX
  };
  
- extern tree c_global_trees[CTI_MAX];
- 
- typedef enum c_language_kind
- {
-   clk_c,           /* A dialect of C: K&R C, ANSI/ISO C89, C2000,
- 		       etc. */
-   clk_cplusplus,   /* ANSI/ISO C++ */
-   clk_objective_c  /* Objective C */
- } 
- c_language_kind;
- 
- /* The variant of the C language being processed.  Each C language
-    front-end defines this variable.  */
- extern c_language_kind c_language;
- 
  #define wchar_type_node			c_global_trees[CTI_WCHAR_TYPE]
  #define signed_wchar_type_node		c_global_trees[CTI_SIGNED_WCHAR_TYPE]
  #define unsigned_wchar_type_node	c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
--- 54,59 ----
*************** extern c_language_kind c_language;
*** 98,103 ****
--- 83,149 ----
  #define g77_longint_type_node		c_global_trees[CTI_G77_LONGINT_TYPE]
  #define g77_ulongint_type_node		c_global_trees[CTI_G77_ULONGINT_TYPE]
  
+ extern tree c_global_trees[CTI_MAX];
+ 
+ typedef enum c_language_kind
+ {
+   clk_c,           /* A dialect of C: K&R C, ANSI/ISO C89, C2000,
+ 		       etc. */
+   clk_cplusplus,   /* ANSI/ISO C++ */
+   clk_objective_c  /* Objective C */
+ } 
+ c_language_kind;
+ 
+ /* The variant of the C language being processed.  Each C language
+    front-end defines this variable.  */
+ 
+ extern c_language_kind c_language;
+ 
+ /* Nonzero means give string constants the type `const char *', rather
+    than `char *'.  */
+ 
+ extern int flag_const_strings;
+ 
+ /* Warn about *printf or *scanf format/argument anomalies. */
+ 
+ extern int warn_format;
+ 
+ /* Nonzero means do some things the same way PCC does.  */
+ 
+ extern int flag_traditional;
+ 
+ /* Nonzero means use the ISO C99 dialect of C.  */
+ 
+ extern int flag_isoc99;
+ 
+ /* Nonzero means warn about suggesting putting in ()'s.  */
+ 
+ extern int warn_parentheses;
+ 
+ /* Warn if a type conversion is done that might have confusing results.  */
+ 
+ extern int warn_conversion;
+ 
+ /* C types are partitioned into three subsets: object, function, and
+    incomplete types.  */
+ #define C_TYPE_OBJECT_P(type) \
+   (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type))
+ 
+ #define C_TYPE_INCOMPLETE_P(type) \
+   (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type) == 0)
+ 
+ #define C_TYPE_FUNCTION_P(type) \
+   (TREE_CODE (type) == FUNCTION_TYPE)
+ 
+ /* For convenience we define a single macro to identify the class of
+    object or incomplete types.  */
+ #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \
+   (!C_TYPE_FUNCTION_P (type))
+ 
+ /* Record in each node resulting from a binary operator
+    what operator was specified for it.  */
+ #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
+ 
  /* Pointer to function to generate the VAR_DECL for __FUNCTION__ etc.
     ID is the identifier to use, NAME is the string.
     TYPE_DEP indicates whether it depends on type of the function or not
*************** extern void constant_expression_warning	
*** 125,130 ****
--- 171,177 ----
  extern tree convert_and_check			PARAMS ((tree, tree));
  extern void overflow_warning			PARAMS ((tree));
  extern void unsigned_conversion_warning		PARAMS ((tree, tree));
+ 
  /* Read the rest of the current #-directive line.  */
  #if USE_CPPLIB
  extern char *get_directive_line			PARAMS ((void));
*************** extern tree build_va_arg			PARAMS ((tree
*** 164,170 ****
  extern int self_promoting_args_p		PARAMS ((tree));
  extern tree simple_type_promotes_to		PARAMS ((tree));
  
! 
  /* These macros provide convenient access to the various _STMT nodes
     created when parsing template declarations.  */
  
--- 211,217 ----
  extern int self_promoting_args_p		PARAMS ((tree));
  extern tree simple_type_promotes_to		PARAMS ((tree));
  
! 
  /* These macros provide convenient access to the various _STMT nodes
     created when parsing template declarations.  */
  
*************** enum c_tree_code {
*** 306,308 ****
--- 353,372 ----
  #undef DEFTREECODE
  
  extern void add_c_tree_codes		        PARAMS ((void));
+ 
+ 
+ /* These functions must be defined by each front-end which implements
+    a variant of the C language.  They are used in c-common.c.  */
+ 
+ extern tree build_unary_op                      PARAMS ((enum tree_code,
+ 							 tree, int));
+ extern tree build_binary_op                     PARAMS ((enum tree_code,
+ 							 tree, tree, int));
+ extern int lvalue_p				PARAMS ((tree));
+ extern tree default_conversion                  PARAMS ((tree));
+ 
+ /* Given two integer or real types, return the type for their sum.
+    Given two compatible ANSI C types, returns the merged type.  */
+ 
+ extern tree common_type                         PARAMS ((tree, tree));
+ 
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-tree.h,v
retrieving revision 1.36
diff -c -p -r1.36 c-tree.h
*** c-tree.h	2000/06/26 16:42:22	1.36
--- c-tree.h	2000/06/29 23:21:21
*************** extern int pedantic;
*** 83,104 ****
     nonzero if the definition of the type has already started.  */
  #define C_TYPE_BEING_DEFINED(type) TYPE_LANG_FLAG_0 (type)
  
- /* C types are partitioned into three subsets: object, function, and
-    incomplete types.  */
- #define C_TYPE_OBJECT_P(type) \
-   (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type))
- 
- #define C_TYPE_FUNCTION_P(type) \
-   (TREE_CODE (type) == FUNCTION_TYPE)
- 
- #define C_TYPE_INCOMPLETE_P(type) \
-   (TREE_CODE (type) != FUNCTION_TYPE && TYPE_SIZE (type) == 0)
- 
- /* For convenience we define a single macro to identify the class of
-    object or incomplete types.  */
- #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \
-   (!C_TYPE_FUNCTION_P (type))
- 
  /* In a RECORD_TYPE, a sorted array of the fields of the type.  */
  struct lang_type
  {
--- 83,88 ----
*************** struct lang_type
*** 115,124 ****
  #define C_TYPE_VARIABLE_SIZE(type) TYPE_LANG_FLAG_1 (type)
  #define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_0 (type)
  
- /* Record in each node resulting from a binary operator
-    what operator was specified for it.  */
- #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
- 
  #if 0 /* Not used.  */
  /* Record whether a decl for a function or function pointer has
     already been mentioned (in a warning) because it was called
--- 99,104 ----
*************** extern tree xref_tag                    
*** 251,266 ****
  /* in c-typeck.c */
  extern tree require_complete_type		PARAMS ((tree));
  extern void incomplete_type_error		PARAMS ((tree, tree));
- /* Given two integer or real types, return the type for their sum.
-    Given two compatible ANSI C types, returns the merged type.  */
- extern tree common_type                         PARAMS ((tree, tree));
  extern int comptypes				PARAMS ((tree, tree));
  extern tree c_sizeof                            PARAMS ((tree));
  extern tree c_sizeof_nowarn                     PARAMS ((tree));
  extern tree c_size_in_bytes                     PARAMS ((tree));
  extern tree c_alignof				PARAMS ((tree));
  extern tree c_alignof_expr			PARAMS ((tree));
- extern tree default_conversion                  PARAMS ((tree));
  extern tree build_component_ref                 PARAMS ((tree, tree));
  extern tree build_indirect_ref                  PARAMS ((tree, const char *));
  extern tree build_array_ref                     PARAMS ((tree, tree));
--- 231,242 ----
*************** extern tree build_external_ref			PARAMS 
*** 268,278 ****
  extern tree build_function_call                 PARAMS ((tree, tree));
  extern tree parser_build_binary_op              PARAMS ((enum tree_code,
  							 tree, tree));
- extern tree build_binary_op                     PARAMS ((enum tree_code,
- 							 tree, tree, int));
- extern tree build_unary_op                      PARAMS ((enum tree_code,
- 							 tree, int));
- extern int lvalue_p				PARAMS ((tree));
  extern int lvalue_or_else			PARAMS ((tree, const char *));
  extern void readonly_warning			PARAMS ((tree, const char *));
  extern int mark_addressable			PARAMS ((tree));
--- 244,249 ----
*************** extern int flag_hosted;
*** 345,356 ****
  
  extern int warn_implicit;
  
- /* Nonzero means give string constants the type `const char *'
-    to get extra warnings from them.  These warnings will be too numerous
-    to be useful, except in thoroughly ANSIfied programs.  */
- 
- extern int flag_const_strings;
- 
  /* Nonzero means warn about sizeof (function) or addition/subtraction
     of function pointers.  */
  
--- 316,321 ----
*************** extern int warn_missing_noreturn;
*** 392,428 ****
  
  extern int warn_traditional;
  
- /* Warn about *printf or *scanf format/argument anomalies. */
- 
- extern int warn_format;
- 
  /* Warn about a subscript that has type char.  */
  
  extern int warn_char_subscripts;
  
- /* Warn if a type conversion is done that might have confusing results.  */
- 
- extern int warn_conversion;
- 
  /* Warn if main is suspicious. */
  
  extern int warn_main;
  
- /* Nonzero means do some things the same way PCC does.  */
- 
- extern int flag_traditional;
- 
- /* Nonzero means use the ISO C99 dialect of C.  */
- 
- extern int flag_isoc99;
- 
  /* Nonzero means to allow single precision math even if we're generally
     being traditional. */
  extern int flag_allow_single_precision;
- 
- /* Nonzero means warn about suggesting putting in ()'s.  */
- 
- extern int warn_parentheses;
  
  /* Warn if initializer is not completely bracketed.  */
  
--- 357,373 ----

Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/call.c,v
retrieving revision 1.225
diff -c -p -r1.225 call.c
*** call.c	2000/06/22 09:27:15	1.225
--- call.c	2000/06/29 23:21:28
*************** builtin:
*** 3444,3450 ****
      case BIT_XOR_EXPR:
      case TRUTH_ANDIF_EXPR:
      case TRUTH_ORIF_EXPR:
!       return build_binary_op (code, arg1, arg2);
  
      case CONVERT_EXPR:
      case NEGATE_EXPR:
--- 3444,3450 ----
      case BIT_XOR_EXPR:
      case TRUTH_ANDIF_EXPR:
      case TRUTH_ORIF_EXPR:
!       return cp_build_binary_op (code, arg1, arg2);
  
      case CONVERT_EXPR:
      case NEGATE_EXPR:
Index: cp/class.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/class.c,v
retrieving revision 1.323
diff -c -p -r1.323 class.c
*** class.c	2000/06/28 20:41:26	1.323
--- class.c	2000/06/29 23:21:33
*************** build_vtable_entry_ref (basetype, vtbl, 
*** 507,513 ****
    i = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i, 0));
    i2 = build_array_ref (vtbl, build_int_2(0,0));
    i2 = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i2, 0));
!   i = build_binary_op (MINUS_EXPR, i, i2);
    i = build_tree_list (build_string (1, "i"), i);
  
    finish_asm_stmt (ridpointers[RID_VOLATILE],
--- 507,513 ----
    i = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i, 0));
    i2 = build_array_ref (vtbl, build_int_2(0,0));
    i2 = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i2, 0));
!   i = cp_build_binary_op (MINUS_EXPR, i, i2);
    i = build_tree_list (build_string (1, "i"), i);
  
    finish_asm_stmt (ridpointers[RID_VOLATILE],
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.491
diff -c -p -r1.491 cp-tree.h
*** cp-tree.h	2000/06/29 14:03:09	1.491
--- cp-tree.h	2000/06/29 23:21:36
*************** extern int warn_ctor_dtor_privacy;
*** 1086,1096 ****
  
  extern int warn_return_type;
  
- /* Nonzero means give string constants the type `const char *', as mandated
-    by the standard.  */
- 
- extern int flag_const_strings;
- 
  /* If non-NULL, dump the tree structure for the entire translation
     unit to this file.  */
  
--- 1086,1091 ----
*************** extern int warn_write_strings;
*** 1106,1115 ****
  
  extern int warn_pointer_arith;
  
- /* Nonzero means warn about suggesting putting in ()'s.  */
- 
- extern int warn_parentheses;
- 
  /* Nonzero means warn about multiple (redundant) decls for the same single
     variable or function.  */
  
--- 1101,1106 ----
*************** extern int warn_char_subscripts;
*** 1136,1145 ****
  
  extern int warn_cast_qual;
  
- /* Warn about *printf or *scanf format/argument anomalies.  */
- 
- extern int warn_format;
- 
  /* Nonzero means warn about non virtual destructors in classes that have
     virtual functions.  */
  
--- 1127,1132 ----
*************** extern tree complete_type_or_else       
*** 4622,4628 ****
  extern int type_unknown_p			PARAMS ((tree));
  extern tree commonparms				PARAMS ((tree, tree));
  extern tree original_type			PARAMS ((tree));
- extern tree common_type				PARAMS ((tree, tree));
  extern int comp_except_specs			PARAMS ((tree, tree, int));
  extern int comptypes				PARAMS ((tree, tree, int));
  extern int comp_target_types			PARAMS ((tree, tree, int));
--- 4609,4614 ----
*************** extern tree c_sizeof_nowarn			PARAMS ((t
*** 4639,4645 ****
  extern tree c_alignof				PARAMS ((tree));
  extern tree inline_conversion			PARAMS ((tree));
  extern tree decay_conversion			PARAMS ((tree));
- extern tree default_conversion			PARAMS ((tree));
  extern tree build_object_ref			PARAMS ((tree, tree, tree));
  extern tree build_component_ref_1		PARAMS ((tree, tree, int));
  extern tree build_component_ref			PARAMS ((tree, tree, tree, int));
--- 4625,4630 ----
*************** extern tree build_function_call			PARAMS
*** 4654,4660 ****
  extern tree build_function_call_maybe		PARAMS ((tree, tree));
  extern tree convert_arguments			PARAMS ((tree, tree, tree, int));
  extern tree build_x_binary_op			PARAMS ((enum tree_code, tree, tree));
- extern tree build_binary_op			PARAMS ((enum tree_code, tree, tree));
  extern tree build_x_unary_op			PARAMS ((enum tree_code, tree));
  extern tree build_unary_op			PARAMS ((enum tree_code, tree, int));
  extern tree unary_complex_lvalue		PARAMS ((enum tree_code, tree));
--- 4639,4644 ----
*************** extern tree type_after_usual_arithmetic_
*** 4690,4695 ****
--- 4674,4681 ----
  extern tree composite_pointer_type              PARAMS ((tree, tree, tree, tree,
  						       const char*));
  extern tree check_return_expr                   PARAMS ((tree));
+ #define cp_build_binary_op(code, arg1, arg2) \
+   build_binary_op(code, arg1, arg2, 1)
  
  /* in typeck2.c */
  extern tree error_not_base_type			PARAMS ((tree, tree));
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.645
diff -c -p -r1.645 decl.c
*** decl.c	2000/06/29 14:03:09	1.645
--- decl.c	2000/06/29 23:21:45
*************** expand_static_init (decl, init)
*** 8607,8614 ****
  
        /* Begin the conditional initialization.  */
        if_stmt = begin_if_stmt ();
!       finish_if_stmt_cond (build_binary_op (EQ_EXPR, temp,
! 					    integer_zero_node),
  			   if_stmt);
        then_clause = begin_compound_stmt (/*has_no_scope=*/0);
  
--- 8607,8614 ----
  
        /* Begin the conditional initialization.  */
        if_stmt = begin_if_stmt ();
!       finish_if_stmt_cond (cp_build_binary_op (EQ_EXPR, temp,
! 					       integer_zero_node),
  			   if_stmt);
        then_clause = begin_compound_stmt (/*has_no_scope=*/0);
  
*************** compute_array_index_type (name, size)
*** 9421,9430 ****
    /* Compute the index of the largest element in the array.  It is
       one less than the number of elements in the array.  */
    itype
!     = fold (build_binary_op (MINUS_EXPR,
! 			     cp_convert (ssizetype, size),
! 			     cp_convert (ssizetype,
! 					 integer_one_node)));
  
    /* Check for variable-sized arrays.  We allow such things as an
       extension, even though they are not allowed in ANSI/ISO C++.  */
--- 9421,9430 ----
    /* Compute the index of the largest element in the array.  It is
       one less than the number of elements in the array.  */
    itype
!     = fold (cp_build_binary_op (MINUS_EXPR,
! 				cp_convert (ssizetype, size),
! 				cp_convert (ssizetype,
! 					    integer_one_node)));
  
    /* Check for variable-sized arrays.  We allow such things as an
       extension, even though they are not allowed in ANSI/ISO C++.  */
*************** build_enumerator (name, value, enumtype)
*** 13377,13385 ****
  	      /* The next value is the previous value ... */
  	      prev_value = DECL_INITIAL (TREE_VALUE (TYPE_VALUES (enumtype)));
  	      /* ... plus one.  */
! 	      value = build_binary_op (PLUS_EXPR,
! 				       prev_value,
! 				       integer_one_node);
  
  	      if (tree_int_cst_lt (value, prev_value))
  		cp_error ("overflow in enumeration values at `%D'", name);
--- 13377,13385 ----
  	      /* The next value is the previous value ... */
  	      prev_value = DECL_INITIAL (TREE_VALUE (TYPE_VALUES (enumtype)));
  	      /* ... plus one.  */
! 	      value = cp_build_binary_op (PLUS_EXPR,
! 					  prev_value,
! 					  integer_one_node);
  
  	      if (tree_int_cst_lt (value, prev_value))
  		cp_error ("overflow in enumeration values at `%D'", name);
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.372
diff -c -p -r1.372 decl2.c
*** decl2.c	2000/06/29 14:03:09	1.372
--- decl2.c	2000/06/29 23:21:49
*************** delete_sanity (exp, size, doing_vec, use
*** 1266,1272 ****
  
    if (doing_vec == 2)
      {
!       maxindex = build_binary_op (MINUS_EXPR, size, integer_one_node);
        pedwarn ("anachronistic use of array size in vector delete");
      }
  
--- 1266,1272 ----
  
    if (doing_vec == 2)
      {
!       maxindex = cp_build_binary_op (MINUS_EXPR, size, integer_one_node);
        pedwarn ("anachronistic use of array size in vector delete");
      }
  
*************** start_static_initialization_or_destructi
*** 3248,3261 ****
    /* Conditionalize this initialization on being in the right priority
       and being initializing/finalizing appropriately.  */
    sentry_if_stmt = begin_if_stmt ();
!   cond = build_binary_op (EQ_EXPR,
! 			  priority_decl,
! 			  build_int_2 (priority, 0));
    init_cond = initp ? integer_one_node : integer_zero_node;
!   init_cond = build_binary_op (EQ_EXPR,
! 			       initialize_p_decl,
! 			       init_cond);
!   cond = build_binary_op (TRUTH_ANDIF_EXPR, cond, init_cond);
  
    /* We need a sentry if this is an object with external linkage that
       might be initialized in more than one place.  (For example, a
--- 3248,3261 ----
    /* Conditionalize this initialization on being in the right priority
       and being initializing/finalizing appropriately.  */
    sentry_if_stmt = begin_if_stmt ();
!   cond = cp_build_binary_op (EQ_EXPR,
! 			     priority_decl,
! 			     build_int_2 (priority, 0));
    init_cond = initp ? integer_one_node : integer_zero_node;
!   init_cond = cp_build_binary_op (EQ_EXPR,
! 				  initialize_p_decl,
! 				  init_cond);
!   cond = cp_build_binary_op (TRUTH_ANDIF_EXPR, cond, init_cond);
  
    /* We need a sentry if this is an object with external linkage that
       might be initialized in more than one place.  (For example, a
*************** start_static_initialization_or_destructi
*** 3275,3293 ****
  	 only if the SENTRY is one, i.e., if we are the last to
  	 destroy the variable.  */
        if (initp)
! 	sentry_cond = build_binary_op (EQ_EXPR,
! 				       build_unary_op (PREINCREMENT_EXPR,
! 						       sentry,
! 						       /*noconvert=*/1),
! 				       integer_one_node);
        else
! 	sentry_cond = build_binary_op (EQ_EXPR,
! 				       build_unary_op (PREDECREMENT_EXPR,
! 						       sentry,
! 						       /*noconvert=*/1),
! 				       integer_zero_node);
  
!       cond = build_binary_op (TRUTH_ANDIF_EXPR, cond, sentry_cond);
      }
  
    finish_if_stmt_cond (cond, sentry_if_stmt);
--- 3275,3295 ----
  	 only if the SENTRY is one, i.e., if we are the last to
  	 destroy the variable.  */
        if (initp)
! 	sentry_cond 
! 	  = cp_build_binary_op (EQ_EXPR,
! 				build_unary_op (PREINCREMENT_EXPR,
! 						sentry,
! 						/*noconvert=*/1),
! 				integer_one_node);
        else
! 	sentry_cond 
! 	  = cp_build_binary_op (EQ_EXPR,
! 				build_unary_op (PREDECREMENT_EXPR,
! 						sentry,
! 						/*noconvert=*/1),
! 				integer_zero_node);
  
!       cond = cp_build_binary_op (TRUTH_ANDIF_EXPR, cond, sentry_cond);
      }
  
    finish_if_stmt_cond (cond, sentry_if_stmt);
Index: cp/error.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/error.c,v
retrieving revision 1.118
diff -c -p -r1.118 error.c
*** error.c	2000/06/23 01:14:39	1.118
--- error.c	2000/06/29 23:21:49
*************** dump_type_suffix (t, flags)
*** 725,731 ****
  	    dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0),
  	               flags & ~TS_EXPR_PARENS);
  	  else
! 	    dump_expr (fold (build_binary_op
  			     (PLUS_EXPR, TYPE_MAX_VALUE (TYPE_DOMAIN (t)),
  			      integer_one_node)),
  	               flags & ~TS_EXPR_PARENS);
--- 725,731 ----
  	    dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0),
  	               flags & ~TS_EXPR_PARENS);
  	  else
! 	    dump_expr (fold (cp_build_binary_op
  			     (PLUS_EXPR, TYPE_MAX_VALUE (TYPE_DOMAIN (t)),
  			      integer_one_node)),
  	               flags & ~TS_EXPR_PARENS);
Index: cp/init.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/init.c,v
retrieving revision 1.204
diff -c -p -r1.204 init.c
*** init.c	2000/06/26 02:18:14	1.204
--- init.c	2000/06/29 23:21:52
*************** resolve_offset_ref (exp)
*** 1899,1907 ****
  	/* Pointer to data members are offset by one, so that a null
  	   pointer with a real value of 0 is distinguishable from an
  	   offset of the first member of a structure.  */
! 	member = build_binary_op (MINUS_EXPR, member,
! 				  cp_convert (ptrdiff_type_node, 
! 					      integer_one_node));
  
        return build1 (INDIRECT_REF, type,
  		     build (PLUS_EXPR, build_pointer_type (type),
--- 1899,1907 ----
  	/* Pointer to data members are offset by one, so that a null
  	   pointer with a real value of 0 is distinguishable from an
  	   offset of the first member of a structure.  */
! 	member = cp_build_binary_op (MINUS_EXPR, member,
! 				     cp_convert (ptrdiff_type_node, 
! 						 integer_one_node));
  
        return build1 (INDIRECT_REF, type,
  		     build (PLUS_EXPR, build_pointer_type (type),
*************** build_new (placement, decl, init, use_gl
*** 2047,2053 ****
  		      nelts = integer_zero_node;
  		    }
  		  else
! 		    nelts = build_binary_op (MULT_EXPR, nelts, this_nelts);
  		}
  	    }
  	  else
--- 2047,2053 ----
  		      nelts = integer_zero_node;
  		    }
  		  else
! 		    nelts = cp_build_binary_op (MULT_EXPR, nelts, this_nelts);
  		}
  	    }
  	  else
*************** build_new_1 (exp)
*** 2258,2264 ****
    while (TREE_CODE (true_type) == ARRAY_TYPE)
      {
        tree this_nelts = array_type_nelts_top (true_type);
!       nelts = build_binary_op (MULT_EXPR, nelts, this_nelts);
        true_type = TREE_TYPE (true_type);
      }
  
--- 2258,2264 ----
    while (TREE_CODE (true_type) == ARRAY_TYPE)
      {
        tree this_nelts = array_type_nelts_top (true_type);
!       nelts = cp_build_binary_op (MULT_EXPR, nelts, this_nelts);
        true_type = TREE_TYPE (true_type);
      }
  
*************** build_new_1 (exp)
*** 2266,2273 ****
      return error_mark_node;
  
    if (has_array)
!     size = fold (build_binary_op (MULT_EXPR, size_in_bytes (true_type),
! 				  nelts));
    else
      size = size_in_bytes (type);
  
--- 2266,2273 ----
      return error_mark_node;
  
    if (has_array)
!     size = fold (cp_build_binary_op (MULT_EXPR, size_in_bytes (true_type),
! 				     nelts));
    else
      size = size_in_bytes (type);
  
*************** build_new_1 (exp)
*** 2393,2399 ****
      {
        tree cookie, exp1;
        rval = convert (string_type_node, rval); /* for ptr arithmetic */
!       rval = save_expr (build_binary_op (PLUS_EXPR, rval, cookie_size));
        /* Store the number of bytes allocated so that we can know how
  	 many elements to destroy later.  */
        if (flag_new_abi)
--- 2393,2399 ----
      {
        tree cookie, exp1;
        rval = convert (string_type_node, rval); /* for ptr arithmetic */
!       rval = save_expr (cp_build_binary_op (PLUS_EXPR, rval, cookie_size));
        /* Store the number of bytes allocated so that we can know how
  	 many elements to destroy later.  */
        if (flag_new_abi)
*************** build_new_1 (exp)
*** 2507,2513 ****
  	rval = (build_vec_init
  		(NULL_TREE, 
  		 save_expr (rval),
! 		 build_binary_op (MINUS_EXPR, nelts, integer_one_node),
  		 init,
  		 /*from_array=*/0));
  
--- 2507,2513 ----
  	rval = (build_vec_init
  		(NULL_TREE, 
  		 save_expr (rval),
! 		 cp_build_binary_op (MINUS_EXPR, nelts, integer_one_node),
  		 init,
  		 /*from_array=*/0));
  
*************** build_new_1 (exp)
*** 2581,2588 ****
    if (check_new && alloc_expr)
      {
        /* Did we modify the storage?  */
!       tree ifexp = build_binary_op (NE_EXPR, alloc_node,
! 				    integer_zero_node);
        rval = build_conditional_expr (ifexp, rval, alloc_node);
      }
  
--- 2581,2588 ----
    if (check_new && alloc_expr)
      {
        /* Did we modify the storage?  */
!       tree ifexp = cp_build_binary_op (NE_EXPR, alloc_node,
! 				       integer_zero_node);
        rval = build_conditional_expr (ifexp, rval, alloc_node);
      }
  
*************** build_vec_delete_1 (base, maxindex, type
*** 2690,2698 ****
  	  cookie_size = get_cookie_size (type);
  	  base_tbd 
  	    = cp_convert (ptype,
! 			  build_binary_op (MINUS_EXPR,
! 					   cp_convert (string_type_node, base),
! 					   cookie_size));
  	  /* True size with header.  */
  	  virtual_size = size_binop (PLUS_EXPR, virtual_size, cookie_size);
  	}
--- 2690,2699 ----
  	  cookie_size = get_cookie_size (type);
  	  base_tbd 
  	    = cp_convert (ptype,
! 			  cp_build_binary_op (MINUS_EXPR,
! 					      cp_convert (string_type_node, 
! 							  base),
! 					      cookie_size));
  	  /* True size with header.  */
  	  virtual_size = size_binop (PLUS_EXPR, virtual_size, cookie_size);
  	}
*************** build_vec_init (decl, base, maxindex, in
*** 3052,3059 ****
        finish_compound_stmt (/*has_no_scope=*/1, try_body);
        finish_cleanup_try_block (try_block);
        e = build_vec_delete_1 (rval,
! 			      build_binary_op (MINUS_EXPR, maxindex, 
! 					       iterator),
  			      type,
  			      sfk_base_destructor,
  			      /*use_global_delete=*/0);
--- 3053,3060 ----
        finish_compound_stmt (/*has_no_scope=*/1, try_body);
        finish_cleanup_try_block (try_block);
        e = build_vec_delete_1 (rval,
! 			      cp_build_binary_op (MINUS_EXPR, maxindex, 
! 						  iterator),
  			      type,
  			      sfk_base_destructor,
  			      /*use_global_delete=*/0);
*************** build_delete (type, addr, auto_delete, f
*** 3248,3254 ****
  	ifexp = integer_one_node;
        else
  	/* Handle deleting a null pointer.  */
! 	ifexp = fold (build_binary_op (NE_EXPR, addr, integer_zero_node));
  
        if (ifexp != integer_one_node)
  	expr = build (COND_EXPR, void_type_node,
--- 3249,3255 ----
  	ifexp = integer_one_node;
        else
  	/* Handle deleting a null pointer.  */
! 	ifexp = fold (cp_build_binary_op (NE_EXPR, addr, integer_zero_node));
  
        if (ifexp != integer_one_node)
  	expr = build (COND_EXPR, void_type_node,
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/rtti.c,v
retrieving revision 1.97
diff -c -p -r1.97 rtti.c
*** rtti.c	2000/06/20 16:13:33	1.97
--- rtti.c	2000/06/29 23:21:54
*************** synthesize_tinfo_fn (fndecl)
*** 1217,1223 ****
    if_stmt = begin_if_stmt ();
    tmp = cp_convert (build_pointer_type (ptr_type_node), addr);
    tmp = build_indirect_ref (tmp, 0);
!   tmp = build_binary_op (EQ_EXPR, tmp, integer_zero_node);
    finish_if_stmt_cond (tmp, if_stmt);
    then_clause = begin_compound_stmt (/*has_no_scope=*/0);
  
--- 1217,1223 ----
    if_stmt = begin_if_stmt ();
    tmp = cp_convert (build_pointer_type (ptr_type_node), addr);
    tmp = build_indirect_ref (tmp, 0);
!   tmp = cp_build_binary_op (EQ_EXPR, tmp, integer_zero_node);
    finish_if_stmt_cond (tmp, if_stmt);
    then_clause = begin_compound_stmt (/*has_no_scope=*/0);
  
*************** synthesize_tinfo_var (target_type, real_
*** 1651,1660 ****
                is_simple = 0;
                
                /* combine offset and flags into one field */
!               offset = build_binary_op (LSHIFT_EXPR, offset,
!                                         build_int_2 (8, 0));
!               offset = build_binary_op (BIT_IOR_EXPR, offset,
!                                         build_int_2 (flags, 0));
                base_init = tree_cons (NULL_TREE, offset, base_init);
                base_init = tree_cons (NULL_TREE, tinfo, base_init);
                base_init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, base_init);
--- 1651,1660 ----
                is_simple = 0;
                
                /* combine offset and flags into one field */
!               offset = cp_build_binary_op (LSHIFT_EXPR, offset,
! 					   build_int_2 (8, 0));
!               offset = cp_build_binary_op (BIT_IOR_EXPR, offset,
! 					   build_int_2 (flags, 0));
                base_init = tree_cons (NULL_TREE, offset, base_init);
                base_init = tree_cons (NULL_TREE, tinfo, base_init);
                base_init = build (CONSTRUCTOR, NULL_TREE, NULL_TREE, base_init);
Index: cp/search.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/search.c,v
retrieving revision 1.185
diff -c -p -r1.185 search.c
*** search.c	2000/06/26 13:16:42	1.185
--- search.c	2000/06/29 23:21:56
*************** expand_upcast_fixups (binfo, addr, orig_
*** 2664,2671 ****
  
  	  /* This is a upcast, so we have to add the offset for the
  	     virtual base.  */
! 	  old_delta = build_binary_op (PLUS_EXPR, old_delta,
! 				       TREE_VALUE (delta));
  	  if (vc)
  	    {
  	      /* If this is set, we need to subtract out the delta
--- 2664,2671 ----
  
  	  /* This is a upcast, so we have to add the offset for the
  	     virtual base.  */
! 	  old_delta = cp_build_binary_op (PLUS_EXPR, old_delta,
! 					  TREE_VALUE (delta));
  	  if (vc)
  	    {
  	      /* If this is set, we need to subtract out the delta
*************** expand_upcast_fixups (binfo, addr, orig_
*** 2689,2695 ****
     
  	      /* This is a downcast, so we have to subtract the offset
  		 for the virtual base.  */
! 	      old_delta = build_binary_op (MINUS_EXPR, old_delta, vc_delta);
  	    }
  
  	  TREE_READONLY (new_delta) = 0;
--- 2689,2695 ----
     
  	      /* This is a downcast, so we have to subtract the offset
  		 for the virtual base.  */
! 	      old_delta = cp_build_binary_op (MINUS_EXPR, old_delta, vc_delta);
  	    }
  
  	  TREE_READONLY (new_delta) = 0;
*************** fixup_all_virtual_upcast_offsets (decl_p
*** 2758,2765 ****
    if (!in_charge_node)
      /* There's no need for any fixups in this case.  */
      return;
!   in_charge_node = build_binary_op (EQ_EXPR, 
! 				    in_charge_node, integer_zero_node);
    if_stmt = begin_if_stmt ();
    finish_if_stmt_cond (in_charge_node, if_stmt);
    
--- 2758,2765 ----
    if (!in_charge_node)
      /* There's no need for any fixups in this case.  */
      return;
!   in_charge_node = cp_build_binary_op (EQ_EXPR, 
! 				       in_charge_node, integer_zero_node);
    if_stmt = begin_if_stmt ();
    finish_if_stmt_cond (in_charge_node, if_stmt);
    
Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.292
diff -c -p -r1.292 typeck.c
*** typeck.c	2000/06/23 06:49:45	1.292
--- typeck.c	2000/06/29 23:22:00
*************** build_array_ref (array, idx)
*** 2502,2508 ****
  	return error_mark_node;
        }
  
!     return build_indirect_ref (build_binary_op (PLUS_EXPR, ar, ind),
  			       "array indexing");
    }
  }
--- 2502,2508 ----
  	return error_mark_node;
        }
  
!     return build_indirect_ref (cp_build_binary_op (PLUS_EXPR, ar, ind),
  			       "array indexing");
    }
  }
*************** get_member_function_from_ptrfunc (instan
*** 2853,2864 ****
  	 easier to make this change.  */
        if (flag_new_abi)
  	{
! 	  idx = build_binary_op (TRUNC_DIV_EXPR, 
! 				 build1 (NOP_EXPR, vtable_index_type, e3),
! 				 TYPE_SIZE_UNIT (vtable_entry_type));
! 	  e1 = build_binary_op (BIT_AND_EXPR,
! 				build1 (NOP_EXPR, vtable_index_type, e3),
! 				integer_one_node);
  	}
        else
  	{
--- 2853,2864 ----
  	 easier to make this change.  */
        if (flag_new_abi)
  	{
! 	  idx = cp_build_binary_op (TRUNC_DIV_EXPR, 
! 				    build1 (NOP_EXPR, vtable_index_type, e3),
! 				    TYPE_SIZE_UNIT (vtable_entry_type));
! 	  e1 = cp_build_binary_op (BIT_AND_EXPR,
! 				   build1 (NOP_EXPR, vtable_index_type, e3),
! 				   integer_one_node);
  	}
        else
  	{
*************** get_member_function_from_ptrfunc (instan
*** 2866,2873 ****
  		       (build_component_ref (function,
  					     index_identifier,
  					     NULL_TREE, 0)));
! 	  e1 = build_binary_op (GE_EXPR, idx, integer_zero_node);
! 	  idx = build_binary_op (MINUS_EXPR, idx, integer_one_node);
  	}
  
        vtbl = convert_pointer_to (ptr_type_node, instance);
--- 2866,2873 ----
  		       (build_component_ref (function,
  					     index_identifier,
  					     NULL_TREE, 0)));
! 	  e1 = cp_build_binary_op (GE_EXPR, idx, integer_zero_node);
! 	  idx = cp_build_binary_op (MINUS_EXPR, idx, integer_one_node);
  	}
  
        vtbl = convert_pointer_to (ptr_type_node, instance);
*************** get_member_function_from_ptrfunc (instan
*** 2891,2897 ****
  	{
  	  aref = save_expr (aref);
  	  
! 	  delta = build_binary_op
  	    (PLUS_EXPR,
  	     build_conditional_expr (e1,
  				     build_component_ref (aref,
--- 2891,2897 ----
  	{
  	  aref = save_expr (aref);
  	  
! 	  delta = cp_build_binary_op
  	    (PLUS_EXPR,
  	     build_conditional_expr (e1,
  				     build_component_ref (aref,
*************** build_x_binary_op (code, arg1, arg2)
*** 3269,3277 ****
     multiple inheritance, and deal with pointer to member functions.  */
  
  tree
! build_binary_op (code, orig_op0, orig_op1)
       enum tree_code code;
       tree orig_op0, orig_op1;
  {
    tree op0, op1;
    register enum tree_code code0, code1;
--- 3269,3278 ----
     multiple inheritance, and deal with pointer to member functions.  */
  
  tree
! build_binary_op (code, orig_op0, orig_op1, convert_p)
       enum tree_code code;
       tree orig_op0, orig_op1;
+      int convert_p ATTRIBUTE_UNUSED;
  {
    tree op0, op1;
    register enum tree_code code0, code1;
*************** build_binary_op (code, orig_op0, orig_op
*** 3633,3639 ****
  	  result_type = TREE_TYPE (op0);
  	}
        else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (op0))
! 	return build_binary_op (code, op1, op0);
        else if (TYPE_PTRMEMFUNC_P (type0) && TYPE_PTRMEMFUNC_P (type1)
  	       && same_type_p (type0, type1))
  	{
--- 3634,3640 ----
  	  result_type = TREE_TYPE (op0);
  	}
        else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (op0))
! 	return cp_build_binary_op (code, op1, op0);
        else if (TYPE_PTRMEMFUNC_P (type0) && TYPE_PTRMEMFUNC_P (type1)
  	       && same_type_p (type0, type1))
  	{
*************** build_binary_op (code, orig_op0, orig_op
*** 3664,3677 ****
  					    NULL_TREE, 0);
  	      delta1 = build_component_ref (op1, delta_identifier,
  					    NULL_TREE, 0);
! 	      e1 = build_binary_op (EQ_EXPR, delta0, delta1);
! 	      e2 = build_binary_op (NE_EXPR, 
! 				    pfn0,
! 				    cp_convert (TREE_TYPE (pfn0),
! 						integer_zero_node));
! 	      e1 = build_binary_op (TRUTH_ORIF_EXPR, e1, e2);
  	      e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
! 	      e = build_binary_op (TRUTH_ANDIF_EXPR, e2, e1);
  	    }
  	  else
  	    {
--- 3665,3678 ----
  					    NULL_TREE, 0);
  	      delta1 = build_component_ref (op1, delta_identifier,
  					    NULL_TREE, 0);
! 	      e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
! 	      e2 = cp_build_binary_op (NE_EXPR, 
! 				       pfn0,
! 				       cp_convert (TREE_TYPE (pfn0),
! 						   integer_zero_node));
! 	      e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2);
  	      e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
! 	      e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1);
  	    }
  	  else
  	    {
*************** build_binary_op (code, orig_op0, orig_op
*** 3691,3711 ****
  	      tree delta21 = DELTA2_FROM_PTRMEMFUNC (op1);
  	      tree e3;
  	      tree integer_neg_one_node
! 		= build_binary_op (MINUS_EXPR, integer_zero_node,
! 				   integer_one_node);
! 	      e1 = build_binary_op (EQ_EXPR, index0, index1);
! 	      e2 = build_binary_op (NE_EXPR, index1, integer_neg_one_node);
! 	      e2 = build_binary_op (TRUTH_ANDIF_EXPR, e2,
! 				    build_binary_op (EQ_EXPR, delta20, delta21));
! 	      /* We can't use build_binary_op for this cmp because it would get
! 	     confused by the ptr to method types and think we want pmfs.  */
  	      e3 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
! 	      e2 = build_binary_op (TRUTH_ORIF_EXPR, e2, e3);
! 	      e = build_binary_op (TRUTH_ANDIF_EXPR, e1, e2);
  	    }
  	  if (code == EQ_EXPR)
  	    return e;
! 	  return build_binary_op (EQ_EXPR, e, integer_zero_node);
  	}
        else if ((TYPE_PTRMEMFUNC_P (type0)
  		&& same_type_p (TYPE_PTRMEMFUNC_FN_TYPE (type0), type1))
--- 3692,3714 ----
  	      tree delta21 = DELTA2_FROM_PTRMEMFUNC (op1);
  	      tree e3;
  	      tree integer_neg_one_node
! 		= cp_build_binary_op (MINUS_EXPR, integer_zero_node,
! 				      integer_one_node);
! 	      e1 = cp_build_binary_op (EQ_EXPR, index0, index1);
! 	      e2 = cp_build_binary_op (NE_EXPR, index1, integer_neg_one_node);
! 	      e2 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2,
! 				       cp_build_binary_op (EQ_EXPR, 
! 							   delta20, delta21));
! 	      /* We can't use build_binary_op for this cmp because it
! 		 would get confused by the ptr to method types and
! 		 think we want pmfs.  */
  	      e3 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
! 	      e2 = cp_build_binary_op (TRUTH_ORIF_EXPR, e2, e3);
! 	      e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e2);
  	    }
  	  if (code == EQ_EXPR)
  	    return e;
! 	  return cp_build_binary_op (EQ_EXPR, e, integer_zero_node);
  	}
        else if ((TYPE_PTRMEMFUNC_P (type0)
  		&& same_type_p (TYPE_PTRMEMFUNC_FN_TYPE (type0), type1))
*************** pointer_int_sum (resultcode, ptrop, into
*** 4161,4167 ****
        enum tree_code subcode = resultcode;
        if (TREE_CODE (intop) == MINUS_EXPR)
  	subcode = (subcode == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR);
!       ptrop = build_binary_op (subcode, ptrop, TREE_OPERAND (intop, 1));
        intop = TREE_OPERAND (intop, 0);
      }
  
--- 4164,4170 ----
        enum tree_code subcode = resultcode;
        if (TREE_CODE (intop) == MINUS_EXPR)
  	subcode = (subcode == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR);
!       ptrop = cp_build_binary_op (subcode, ptrop, TREE_OPERAND (intop, 1));
        intop = TREE_OPERAND (intop, 0);
      }
  
*************** pointer_int_sum (resultcode, ptrop, into
*** 4176,4184 ****
       pointer type (actually unsigned integral).  */
  
    intop = cp_convert (result_type,
! 		      build_binary_op (MULT_EXPR, intop,
! 				       cp_convert (TREE_TYPE (intop),
! 						   size_exp)));
  
    /* Create the sum or difference.  */
  
--- 4179,4187 ----
       pointer type (actually unsigned integral).  */
  
    intop = cp_convert (result_type,
! 		      cp_build_binary_op (MULT_EXPR, intop,
! 					  cp_convert (TREE_TYPE (intop),
! 						      size_exp)));
  
    /* Create the sum or difference.  */
  
*************** pointer_diff (op0, op1, ptrtype)
*** 4220,4227 ****
    /* First do the subtraction as integers;
       then drop through to build the divide operator.  */
  
!   op0 = build_binary_op (MINUS_EXPR, cp_convert (restype, op0),
! 			 cp_convert (restype, op1));
  
    /* This generates an error if op1 is a pointer to an incomplete type.  */
    if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (op1))))
--- 4223,4231 ----
    /* First do the subtraction as integers;
       then drop through to build the divide operator.  */
  
!   op0 = cp_build_binary_op (MINUS_EXPR, 
! 			    cp_convert (restype, op0),
! 			    cp_convert (restype, op1));
  
    /* This generates an error if op1 is a pointer to an incomplete type.  */
    if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (op1))))
*************** build_unary_op (code, xarg, noconvert)
*** 4652,4659 ****
  	{
  	  if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
  	    return error_mark_node;
! 	  return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
! 				  TREE_OPERAND (arg, 1));
  	}
  
        /* Uninstantiated types are all functions.  Taking the
--- 4656,4663 ----
  	{
  	  if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
  	    return error_mark_node;
! 	  return cp_build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
! 				     TREE_OPERAND (arg, 1));
  	}
  
        /* Uninstantiated types are all functions.  Taking the
*************** build_modify_expr (lhs, modifycode, rhs)
*** 5692,5698 ****
    else
      {
        lhs = stabilize_reference (lhs);
!       newrhs = build_binary_op (modifycode, lhs, rhs);
        if (newrhs == error_mark_node)
  	{
  	  cp_error ("  in evaluation of `%Q(%#T, %#T)'", modifycode,
--- 5696,5702 ----
    else
      {
        lhs = stabilize_reference (lhs);
!       newrhs = cp_build_binary_op (modifycode, lhs, rhs);
        if (newrhs == error_mark_node)
  	{
  	  cp_error ("  in evaluation of `%Q(%#T, %#T)'", modifycode,
*************** get_delta_difference (from, to, force)
*** 6016,6024 ****
        delta = BINFO_OFFSET (binfo);
        delta = cp_convert (ptrdiff_type_node, delta);
        
!       return build_binary_op (MINUS_EXPR,
! 			      integer_zero_node,
! 			      delta);
      }
  
    if (binfo_from_vbase (binfo))
--- 6020,6028 ----
        delta = BINFO_OFFSET (binfo);
        delta = cp_convert (ptrdiff_type_node, delta);
        
!       return cp_build_binary_op (MINUS_EXPR,
! 				 integer_zero_node,
! 				 delta);
      }
  
    if (binfo_from_vbase (binfo))
*************** build_ptrmemfunc (type, pfn, force)
*** 6184,6190 ****
  	  n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
  				    TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
  				    force);
! 	  delta = build_binary_op (PLUS_EXPR, delta, n);
  	  return build_ptrmemfunc1 (to_type, delta, NULL_TREE, npfn,
  				    NULL_TREE);
  	}
--- 6188,6194 ----
  	  n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
  				    TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
  				    force);
! 	  delta = cp_build_binary_op (PLUS_EXPR, delta, n);
  	  return build_ptrmemfunc1 (to_type, delta, NULL_TREE, npfn,
  				    NULL_TREE);
  	}
*************** build_ptrmemfunc (type, pfn, force)
*** 6215,6222 ****
        n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
  				TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
  				force);
!       delta = build_binary_op (PLUS_EXPR, ndelta, n);
!       delta2 = build_binary_op (PLUS_EXPR, ndelta2, n);
        e1 = fold (build (GT_EXPR, boolean_type_node, idx, integer_zero_node));
  	  
        /* If it's a virtual function, this is what we want.  */
--- 6219,6226 ----
        n = get_delta_difference (TYPE_PTRMEMFUNC_OBJECT_TYPE (pfn_type),
  				TYPE_PTRMEMFUNC_OBJECT_TYPE (to_type),
  				force);
!       delta = cp_build_binary_op (PLUS_EXPR, ndelta, n);
!       delta2 = cp_build_binary_op (PLUS_EXPR, ndelta2, n);
        e1 = fold (build (GT_EXPR, boolean_type_node, idx, integer_zero_node));
  	  
        /* If it's a virtual function, this is what we want.  */





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