summaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-04-12 15:27:07 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-04-12 15:27:07 +0200
commitfa8351f8d807ec9cde27984171670438295bc7b4 (patch)
treece69281cf285db8a82e42170e80479229135cc7d /gcc/c-typeck.c
parentf101882ada10af2b1b682e56f7a52c248ed6eef5 (diff)
downloadgcc-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.c4
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);
}