diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-05 08:16:15 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-05 08:16:15 +0000 |
| commit | c062fdafbc4cef4f2cd065edfef0d470530b5a5a (patch) | |
| tree | 4bfd9a9100a0110ce7150d1fd392cd3496327a46 /gcc/stmt.c | |
| parent | 7d4fcfa08077625ed51a724192442aa577c34063 (diff) | |
| download | ppe42-gcc-c062fdafbc4cef4f2cd065edfef0d470530b5a5a.tar.gz ppe42-gcc-c062fdafbc4cef4f2cd065edfef0d470530b5a5a.zip | |
* stmt.c (warn_if_unused_value): Move side effects test earlier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
| -rw-r--r-- | gcc/stmt.c | 8 |
1 files changed, 4 insertions, 4 deletions
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. */ |

