From eca93b05990a8a50236ea4a78959a39e0c94e04b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 5 Dec 2000 00:16:15 -0800 Subject: [PATCH] * stmt.c (warn_if_unused_value): Move side effects test earlier. From-SVN: r38030 --- gcc/ChangeLog | 4 ++++ gcc/stmt.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9146bd78a3..dccfdf84b90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2000-12-05 Richard Henderson + + * stmt.c (warn_if_unused_value): Move side effects test earlier. + 2000-12-05 Alan Modra * bb-reorder.c (reorder_basic_blocks): Do check for EH edges even diff --git a/gcc/stmt.c b/gcc/stmt.c index 06242ce8e09..d4b047c9a9c 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. */ -- 2.30.2