OSDN Git Service

* stmt.c (warn_if_unused_value): Move side effects test earlier.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Dec 2000 08:16:15 +0000 (08:16 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Dec 2000 08:16:15 +0000 (08:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38030 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stmt.c

index e9146bd..dccfdf8 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-05  Richard Henderson  <rth@redhat.com>
+
+       * stmt.c (warn_if_unused_value): Move side effects test earlier.
+
 2000-12-05  Alan Modra <alan@linuxcare.com.au>
 
        * bb-reorder.c (reorder_basic_blocks): Do check for EH edges even
index 06242ce..d4b047c 100644 (file)
@@ -1983,6 +1983,10 @@ warn_if_unused_value (exp)
   if (VOID_TYPE_P (TREE_TYPE (exp)))
     return 0;
 
+  /* If this is an expression with side effects, don't warn.  */
+  if (TREE_SIDE_EFFECTS (exp))
+    return 0;
+
   switch (TREE_CODE (exp))
     {
     case PREINCREMENT_EXPR:
@@ -2058,10 +2062,6 @@ warn_if_unused_value (exp)
          && TREE_THIS_VOLATILE (exp))
        return 0;
 
-      /* If this is an expression with side effects, don't warn.  */
-      if (TREE_SIDE_EFFECTS (exp))
-       return 0;
-
       /* If this is an expression which has no operands, there is no value
         to be unused.  There are no such language-independent codes,
         but front ends may define such.  */