aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-12-05 00:16:15 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-12-05 00:16:15 -0800
commiteca93b05990a8a50236ea4a78959a39e0c94e04b (patch)
tree4bfd9a9100a0110ce7150d1fd392cd3496327a46 /gcc/stmt.c
parent7d3615831e1495c3181b108a3dd510382a997abc (diff)
downloadgcc-eca93b05990a8a50236ea4a78959a39e0c94e04b.zip
gcc-eca93b05990a8a50236ea4a78959a39e0c94e04b.tar.gz
gcc-eca93b05990a8a50236ea4a78959a39e0c94e04b.tar.bz2
* stmt.c (warn_if_unused_value): Move side effects test earlier.
From-SVN: r38030
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 06242ce..d4b047c 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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. */