OSDN Git Service

* c-typeck.c (parser_build_binary_op): Condition warnings for
[pf3gnuchains/gcc-fork.git] / gcc / c-typeck.c
index e5f9491..4befd12 100644 (file)
@@ -2170,12 +2170,13 @@ parser_build_binary_op (enum tree_code code, tree arg1, tree arg2)
          if (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<')
            warning ("suggest parentheses around comparison in operand of &");
        }
-    }
+      /* Similarly, check for cases like 1<=i<=10 that are probably errors.  */
+      if (TREE_CODE_CLASS (code) == '<'
+         && (TREE_CODE_CLASS (code1) == '<'
+             || TREE_CODE_CLASS (code2) == '<'))
+       warning ("comparisons like X<=Y<=Z do not have their mathematical meaning");
 
-  /* Similarly, check for cases like 1<=i<=10 that are probably errors.  */
-  if (TREE_CODE_CLASS (code) == '<' && extra_warnings
-      && (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<'))
-    warning ("comparisons like X<=Y<=Z do not have their mathematical meaning");
+    }
 
   unsigned_conversion_warning (result, arg1);
   unsigned_conversion_warning (result, arg2);
@@ -2303,7 +2304,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
         is enough to prevent anybody from looking inside for
         associativity, but won't generate any code.  */
       if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
-           || typecode == COMPLEX_TYPE))
+           || typecode == COMPLEX_TYPE
+           || typecode == VECTOR_TYPE))
        {
          error ("wrong type argument to unary plus");
          return error_mark_node;
@@ -6187,65 +6189,6 @@ build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers,
     }
   return args;
 }
-
-/* Expand an ASM statement with operands, handling output operands
-   that are not variables or INDIRECT_REFS by transforming such
-   cases into cases that expand_asm_operands can handle.
-
-   Arguments are same as for expand_asm_operands.  */
-
-void
-c_expand_asm_operands (tree string, tree outputs, tree inputs,
-                      tree clobbers, int vol, location_t locus)
-{
-  int noutputs = list_length (outputs);
-  int i;
-  /* o[I] is the place that output number I should be written.  */
-  tree *o = alloca (noutputs * sizeof (tree));
-  tree tail;
-
-  /* Record the contents of OUTPUTS before it is modified.  */
-  for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
-    {
-      o[i] = TREE_VALUE (tail);
-      if (o[i] == error_mark_node)
-       return;
-    }
-
-  /* Generate the ASM_OPERANDS insn; store into the TREE_VALUEs of
-     OUTPUTS some trees for where the values were actually stored.  */
-  expand_asm_operands (string, outputs, inputs, clobbers, vol, locus);
-
-  /* Copy all the intermediate outputs into the specified outputs.  */
-  for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
-    {
-      if (o[i] != TREE_VALUE (tail))
-       {
-         expand_expr (build_modify_expr (o[i], NOP_EXPR, TREE_VALUE (tail)),
-                      NULL_RTX, VOIDmode, EXPAND_NORMAL);
-         free_temp_slots ();
-
-         /* Restore the original value so that it's correct the next
-            time we expand this function.  */
-         TREE_VALUE (tail) = o[i];
-       }
-      /* Detect modification of read-only values.
-        (Otherwise done by build_modify_expr.)  */
-      else
-       {
-         tree type = TREE_TYPE (o[i]);
-         if (TREE_READONLY (o[i])
-             || TYPE_READONLY (type)
-             || ((TREE_CODE (type) == RECORD_TYPE
-                  || TREE_CODE (type) == UNION_TYPE)
-                 && C_TYPE_FIELDS_READONLY (type)))
-           readonly_error (o[i], "modification by `asm'");
-       }
-    }
-
-  /* Those MODIFY_EXPRs could do autoincrements.  */
-  emit_queue ();
-}
 \f
 /* Generate a goto statement to LABEL.  */
 
@@ -6554,11 +6497,9 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
 {
   tree entry = NULL, exit = NULL, t;
 
-  /* Force zeros to NULL so that we don't test them.  */
-  if (cond && integer_zerop (cond))
-    cond = NULL;
-
   /* Detect do { ... } while (0) and don't generate loop construct.  */
+  if (cond && !cond_is_first && integer_zerop (cond))
+    cond = NULL;
   if (cond_is_first || cond)
     {
       tree top = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
@@ -6642,7 +6583,7 @@ emit_side_effect_warnings (tree expr)
     {
       if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
        warning ("%Hstatement with no effect",
-                EXPR_LOCUS (expr) ? EXPR_LOCUS (expr) : &input_location);
+                EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location);
     }
   else if (warn_unused_value)
     warn_if_unused_value (expr, input_location);