diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-04-12 15:27:07 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-04-12 15:27:07 +0200 |
commit | fa8351f8d807ec9cde27984171670438295bc7b4 (patch) | |
tree | ce69281cf285db8a82e42170e80479229135cc7d /gcc/c-typeck.c | |
parent | f101882ada10af2b1b682e56f7a52c248ed6eef5 (diff) | |
download | gcc-fa8351f8d807ec9cde27984171670438295bc7b4.tar.gz |
re PR bootstrap/43699 ("variable set but not used" error during bootstrap)
PR bootstrap/43699
* c-typeck.c (c_process_expr_stmt): Call mark_exp_read even
for exprs satisfying handled_component_p.
* gcc.dg/Wunused-var-7.c: New test.
From-SVN: r158224
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 2296cbe2f93..681c0e42df9 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -8826,11 +8826,13 @@ c_process_expr_stmt (location_t loc, tree expr) && warn_unused_value) emit_side_effect_warnings (loc, expr); + if (DECL_P (expr) || handled_component_p (expr)) + mark_exp_read (expr); + /* If the expression is not of a type to which we cannot assign a line number, wrap the thing in a no-op NOP_EXPR. */ if (DECL_P (expr) || CONSTANT_CLASS_P (expr)) { - mark_exp_read (expr); expr = build1 (NOP_EXPR, TREE_TYPE (expr), expr); SET_EXPR_LOCATION (expr, loc); } |