summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-14 18:47:14 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-14 18:47:14 +0000
commit51a40400500a1101e031d9d8493e669821359d9b (patch)
tree07d7c13f0925b50b9afcb90837dc0a63527d31ac
parent8828f7b766181dbc7e0a8a648108b756ba68ed23 (diff)
downloadgcc-51a40400500a1101e031d9d8493e669821359d9b.tar.gz
* c-typeck.c (emit_side_effect_warnings): Use EXPR_HAS_LOCATION
instead of EXPR_LOCUS in a boolean context, which is always true if --enable-mapped-location. * stmt.c (warn_if_unused_value): Likewise. Also use EXPR_LOCATION. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84698 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-typeck.c2
-rw-r--r--gcc/stmt.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 166737dd3bd..62033604e75 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-14 Per Bothner <per@bothner.com>
+
+ * c-typeck.c (emit_side_effect_warnings): Use EXPR_HAS_LOCATION
+ instead of EXPR_LOCUS in a boolean context, which is always true
+ if --enable-mapped-location.
+ * stmt.c (warn_if_unused_value): Likewise. Also use EXPR_LOCATION.
+
2004-07-14 Richard Henderson <rth@redhat.com>
* dominance.c (struct dom_info): Add fake_exit_edge.
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 2c6df142597..2495550ed54 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -6582,7 +6582,7 @@ emit_side_effect_warnings (tree expr)
{
if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
warning ("%Hstatement with no effect",
- EXPR_LOCUS (expr) ? EXPR_LOCUS (expr) : &input_location);
+ EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location);
}
else if (warn_unused_value)
warn_if_unused_value (expr, input_location);
diff --git a/gcc/stmt.c b/gcc/stmt.c
index e9c6e5e2296..d63dad57c33 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1634,8 +1634,8 @@ warn_if_unused_value (tree exp, location_t locus)
if (VOID_TYPE_P (TREE_TYPE (exp)))
return 0;
- if (EXPR_LOCUS (exp))
- locus = *EXPR_LOCUS (exp);
+ if (EXPR_HAS_LOCATION (exp))
+ locus = EXPR_LOCATION (exp);
switch (TREE_CODE (exp))
{