This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to use EXPR_HAS_LOCATION


I checked this patch in as obvious.  It makes no difference in the
normal case, but it fixes a couple of failures in the
--enable-mapped-location configuration.

With this patch the only --enable-mapped-location regressions
are a group of pch-related "assembly comparison" failures.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

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.

Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.338
diff -u -p -r1.338 c-typeck.c
--- c-typeck.c	9 Jul 2004 23:20:30 -0000	1.338
+++ c-typeck.c	14 Jul 2004 18:41:25 -0000
@@ -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);
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.376
diff -u -p -r1.376 stmt.c
--- stmt.c	14 Jul 2004 07:30:20 -0000	1.376
+++ stmt.c	14 Jul 2004 18:41:27 -0000
@@ -1634,8 +1634,8 @@ warn_if_unused_value (tree exp, location
   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))
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]