* c-typeck.c: Remove #if 0 clauses.
authorNathanael Nerode <neroden@gcc.gnu.org>
Fri, 13 Jun 2003 16:23:35 +0000 (16:23 +0000)
committerNathanael Nerode <neroden@gcc.gnu.org>
Fri, 13 Jun 2003 16:23:35 +0000 (16:23 +0000)
From-SVN: r67905

gcc/ChangeLog
gcc/c-typeck.c

index 43d2c5f24502223f75c6ed697dd167e0ee98cacc..8327e0f26ffae18f97673d475584ba889cf3d9d1 100644 (file)
@@ -1,5 +1,7 @@
 2003-06-13  Nathanael Nerode  <neroden@gcc.gnu.org>
 
+       * c-typeck.c: Remove #if 0 clauses.
+
        PR other/1494
        * config/alpha/openbsd.h, config/i386/openbsd.h,
        config/m68k/openbsd.h, config/sparc/openbsd.h: Remove
index c4e482ee240b990d186387753e54890b2be59309..8d6ed0be9fddca702900bb0ae3b7f31ef28df5ef 100644 (file)
@@ -334,10 +334,6 @@ common_type (t1, t2)
                                  TYPE_QUALS (pointed_to_2)));
        return build_type_attribute_variant (t1, attributes);
       }
-#if 0
-      t1 = build_pointer_type (common_type (TREE_TYPE (t1), TREE_TYPE (t2)));
-      return build_type_attribute_variant (t1, attributes);
-#endif
 
     case ARRAY_TYPE:
       {
@@ -1714,14 +1710,6 @@ convert_arguments (typelist, values, name, fundecl)
                               && TREE_CODE (TREE_OPERAND (val, 0)) == INTEGER_CST
                               && int_fits_type_p (TREE_OPERAND (val, 0), type))
                        ;
-#if 0 /* We never get such tree structure here.  */
-                     else if (TREE_CODE (TREE_TYPE (val)) == ENUMERAL_TYPE
-                              && int_fits_type_p (TYPE_MIN_VALUE (TREE_TYPE (val)), type)
-                              && int_fits_type_p (TYPE_MAX_VALUE (TREE_TYPE (val)), type))
-                       /* Change in signedness doesn't matter
-                          if an enum value is unaffected.  */
-                       ;
-#endif
                      /* If the value is extended from a narrower
                         unsigned type, it doesn't matter whether we
                         pass it as signed or unsigned; the value
@@ -3028,28 +3016,6 @@ build_unary_op (code, xarg, flag)
       if (val != 0)
        return val;
 
-#if 0 /* Turned off because inconsistent;
-        float f; *&(int)f = 3.4 stores in int format
-        whereas (int)f = 3.4 stores in float format.  */
-      /* Address of a cast is just a cast of the address
-        of the operand of the cast.  */
-      switch (TREE_CODE (arg))
-       {
-       case NOP_EXPR:
-       case CONVERT_EXPR:
-       case FLOAT_EXPR:
-       case FIX_TRUNC_EXPR:
-       case FIX_FLOOR_EXPR:
-       case FIX_ROUND_EXPR:
-       case FIX_CEIL_EXPR:
-         if (pedantic)
-           pedwarn ("ISO C forbids the address of a cast expression");
-         return convert (build_pointer_type (TREE_TYPE (arg)),
-                         build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0),
-                                         0));
-       }
-#endif
-
       /* Anything not already handled and not a true memory reference
         or a non-lvalue array is an error.  */
       else if (typecode != FUNCTION_TYPE && !flag
@@ -3115,35 +3081,6 @@ build_unary_op (code, xarg, flag)
   return fold (build1 (code, argtype, arg));
 }
 
-#if 0
-/* If CONVERSIONS is a conversion expression or a nested sequence of such,
-   convert ARG with the same conversions in the same order
-   and return the result.  */
-
-static tree
-convert_sequence (conversions, arg)
-     tree conversions;
-     tree arg;
-{
-  switch (TREE_CODE (conversions))
-    {
-    case NOP_EXPR:
-    case CONVERT_EXPR:
-    case FLOAT_EXPR:
-    case FIX_TRUNC_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
-    case FIX_CEIL_EXPR:
-      return convert (TREE_TYPE (conversions),
-                     convert_sequence (TREE_OPERAND (conversions, 0),
-                                       arg));
-
-    default:
-      return arg;
-    }
-}
-#endif /* 0 */
-
 /* Return nonzero if REF is an lvalue valid for this language.
    Lvalues can be assigned, unless their type has TYPE_READONLY.
    Lvalues can have their address taken, unless they have DECL_REGISTER.  */
@@ -3367,11 +3304,6 @@ c_mark_addressable (exp)
        /* drops in */
       case FUNCTION_DECL:
        TREE_ADDRESSABLE (x) = 1;
-#if 0  /* poplevel deals with this now.  */
-       if (DECL_CONTEXT (x) == 0)
-         TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-#endif
-
       default:
        return true;
     }
@@ -3392,23 +3324,6 @@ build_conditional_expr (ifexp, op1, op2)
 
   ifexp = c_common_truthvalue_conversion (default_conversion (ifexp));
 
-#if 0 /* Produces wrong result if within sizeof.  */
-  /* Don't promote the operands separately if they promote
-     the same way.  Return the unpromoted type and let the combined
-     value get promoted if necessary.  */
-
-  if (TREE_TYPE (op1) == TREE_TYPE (op2)
-      && TREE_CODE (TREE_TYPE (op1)) != ARRAY_TYPE
-      && TREE_CODE (TREE_TYPE (op1)) != ENUMERAL_TYPE
-      && TREE_CODE (TREE_TYPE (op1)) != FUNCTION_TYPE)
-    {
-      if (TREE_CODE (ifexp) == INTEGER_CST)
-       return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
-
-      return fold (build (COND_EXPR, TREE_TYPE (op1), ifexp, op1, op2));
-    }
-#endif
-
   /* Promote both alternatives.  */
 
   if (TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE)
@@ -3580,14 +3495,6 @@ internal_build_compound_expr (list, first_p)
        TREE_VALUE (list)
          = default_function_array_conversion (TREE_VALUE (list));
 
-#if 0 /* If something inside inhibited lvalueness, we should not override.  */
-      /* Consider (x, y+0), which is not an lvalue since y+0 is not.  */
-
-      /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
-      if (TREE_CODE (list) == NON_LVALUE_EXPR)
-       list = TREE_OPERAND (list, 0);
-#endif
-
       /* Don't let (0, 0) be null pointer constant.  */
       if (!first_p && integer_zerop (TREE_VALUE (list)))
        return non_lvalue (TREE_VALUE (list));
@@ -3640,12 +3547,6 @@ build_c_cast (type, expr)
   if (!flag_objc || !objc_is_id (type))
     type = TYPE_MAIN_VARIANT (type);
 
-#if 0
-  /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
-  if (TREE_CODE (value) == NON_LVALUE_EXPR)
-    value = TREE_OPERAND (value, 0);
-#endif
-
   if (TREE_CODE (type) == ARRAY_TYPE)
     {
       error ("cast specifies array type");
@@ -4460,35 +4361,6 @@ store_init_value (decl, init)
 
   /* Store the expression if valid; else report error.  */
 
-#if 0
-  /* Note that this is the only place we can detect the error
-     in a case such as   struct foo bar = (struct foo) { x, y };
-     where there is one initial value which is a constructor expression.  */
-  if (value == error_mark_node)
-    ;
-  else if (TREE_STATIC (decl) && ! TREE_CONSTANT (value))
-    {
-      error ("initializer for static variable is not constant");
-      value = error_mark_node;
-    }
-  else if (TREE_STATIC (decl)
-          && initializer_constant_valid_p (value, TREE_TYPE (value)) == 0)
-    {
-      error ("initializer for static variable uses complicated arithmetic");
-      value = error_mark_node;
-    }
-  else
-    {
-      if (pedantic && TREE_CODE (value) == CONSTRUCTOR)
-       {
-         if (! TREE_CONSTANT (value))
-           pedwarn ("aggregate initializer is not constant");
-         else if (! TREE_STATIC (value))
-           pedwarn ("aggregate initializer uses complicated arithmetic");
-       }
-    }
-#endif
-
   if (warn_traditional && !in_system_header
       && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && ! TREE_STATIC (decl))
     warning ("traditional C rejects automatic aggregate initialization");