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] Delete EXPR_LOCUS


Hi,

this patch removes EXPR_LOCUS and all traces of indirection from the source 
location business.  This means changing the signature of the 'H' specifier 
from location_t* to location_t, hence a few warnings during stage #1.

Tested on x86_64-suse-linux, OK for mainline?


2009-04-23  Eric Botcazou  <ebotcazou@adacore.com>

	* builtins.c (fold_call_expr): Do not test CAN_HAVE_LOCATION_P.
	* c-common.c (c_do_switch_warnings): Pass locations directly.
	* c-decl.c (undeclared_variable, define_label, pending_xref_error,
	store_parm_decls_oldstyle): Likewise.
	* c-format.c (init_dynamic_diag_info): Do not use indirection for 'H'.
	* c-lex.c (cb_def_pragma): Pass locations directly.
	(c_lex_with_flags): Likewise.
	* c-typeck.c (build_unary_op): Do not test EXPR_P.
	(c_finish_if_stmt): Pass locations directly.
	(emit_side_effect_warnings): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	(c_finish_stmt_expr): Likewise.
	* fold-const.c (fold_undefer_overflow_warnings): Pass locations
	directly.
	* gimplify.c (internal_get_tmp_var): Use EXPR_LOCATION in lieu of
	EXPR_LOCUS.
	(gimplify_call_expr): Likewise.
	(omp_notice_variable): Pass locations directly.
	(gimplify_one_sizepos): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	* pretty-print.c (pp_base_format) <'H'>: Remove indirection.
	* stmt.c (warn_if_unused_value) <warn>: Pass locations directly.
	* tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
	* tree-vrp.c (vrp_evaluate_conditional): Likewise.
	(simplify_div_or_mod_using_ranges): Likewise.
	(simplify_abs_using_ranges): Likewise.
	* tree.c (set_expr_locus): Delete.
	* tree.h (set_expr_locus): Likewise.
	(EXPR_LOCUS, SET_EXPR_LOCUS): Likewise.
	* value-prof.c (check_counter): Likewise.
ada/
	* gcc-interface/trans.c (gnat_to_gnu): Use CAN_HAVE_LOCATION_P.
	(gnat_gimplify_expr): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
cp/
	* decl.c (identify_goto): Change LOCUS type.
	(check_previous_goto_1): Likewise.
	(check_previous_goto): Pass locations directly.
	(check_switch_goto): Likewise.
	* except.c (check_handlers_1): Likewise.
	(check_handlers): Likewise.
	* parser.c (cp_parser_error, cp_parser_name_lookup_error,
	cp_parser_check_decl_spec, cp_parser_check_for_definition_in_return,
	cp_parser_check_for_invalid_template_id,
	cp_parser_diagnose_invalid_type_name,
	cp_parser_string_literal, cp_parser_primary_expression,
	cp_parser_unqualified_id, cp_parser_nested_name_specifier_opt,
	cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
	cp_parser_direct_new_declarator, cp_parser_binary_expression,
	cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
	cp_parser_selection_statement, cp_parser_jump_statement,
	cp_parser_block_declaration, cp_parser_simple_declaration,
	cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt,
	cp_parser_mem_initializer_list, cp_parser_mem_initializer_id,
	cp_parser_template_parameter, cp_parser_type_parameter,
	cp_parser_template_id, cp_parser_template_name,
	cp_parser_template_argument_list, cp_parser_explicit_specialization,
	cp_parser_namespace_name, cp_parser_namespace_alias_definition,
	cp_parser_using_declaration, cp_parser_init_declarator,
	cp_parser_direct_declarator, cp_parser_ptr_operator,
	cp_parser_cv_qualifier_seq_opt, cp_parser_parameter_declaration,
	cp_parser_class_name, cp_parser_class_head,
	cp_parser_member_declaration, cp_parser_pure_specifier,
	cp_parser_base_specifier, cp_parser_lookup_name,
	cp_parser_check_template_parameters,
	cp_parser_function_definition_after_decl,
	cp_parser_template_declaration_after_exp, cp_parser_single_declaration,
	cp_parser_enclosed_template_argument_lis, cp_parser_set_storage_class,
	cp_parser_check_access_in_redeclaration,
	cp_parser_optional_template_keyword, cp_parser_objc_expression,
	cp_parser_objc_encode_expression, cp_parser_objc_selector,
	cp_parser_objc_protocol_declaration, cp_parser_objc_declaration,
	cp_parser_objc_statement, check_no_duplicate_clause,
	cp_parser_omp_clause_collapse, cp_parser_omp_clause_schedule,
	cp_parser_omp_all_clauses,
	cp_parser_omp_for_loop, cp_parser_initial_pragma cp_parser_pragma):
	Likewise.
	* semantics.c (qualified_name_lookup_error): Likewise.
	(finalize_nrv_r): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	(handle_omp_for_class_iterator): Pass locations directly.
	(finish_omp_for): Likewise.
java/
	* jcf-parse.c (duplicate_class_warning): Likewise.
objc/
	* objc-act.c (build_selector_translation_table): Likewise.  Use
	EXPR_LOCATION in lieu of EXPR_LOCUS.
testsuite/
	* gcc.dg/format/gcc_diag-1.c: Adjust for new spec of 'H'.


-- 
Eric Botcazou
Index: tree-vrp.c
===================================================================
--- tree-vrp.c	(revision 146626)
+++ tree-vrp.c	(working copy)
@@ -5704,7 +5704,7 @@ vrp_evaluate_conditional (enum tree_code
 	    location = input_location;
 	  else
 	    location = gimple_location (stmt);
-	  warning (OPT_Wstrict_overflow, "%H%s", &location, warnmsg);
+	  warning (OPT_Wstrict_overflow, "%H%s", location, warnmsg);
 	}
     }
 
@@ -5745,7 +5745,7 @@ vrp_evaluate_conditional (enum tree_code
 	  else
 	    location = gimple_location (stmt);
 
-	  warning (OPT_Wtype_limits, "%H%s", &location, warnmsg);
+	  warning (OPT_Wtype_limits, "%H%s", location, warnmsg);
 	}
     }
 
@@ -6586,7 +6586,7 @@ simplify_div_or_mod_using_ranges (gimple
 	  warning (OPT_Wstrict_overflow,
 		   ("%Hassuming signed overflow does not occur when "
 		    "simplifying / or %% to >> or &"),
-		   &location);
+		    location);
 	}
     }
 
@@ -6669,7 +6669,7 @@ simplify_abs_using_ranges (gimple stmt)
 	      warning (OPT_Wstrict_overflow,
 		       ("%Hassuming signed overflow does not occur when "
 			"simplifying abs (X) to X or -X"),
-		       &location);
+		        location);
 	    }
 
 	  gimple_assign_set_rhs1 (stmt, op);
Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c	(revision 146626)
+++ tree-ssa-loop-niter.c	(working copy)
@@ -1877,7 +1877,7 @@ number_of_iterations_exit (struct loop *
 	  : N_("cannot optimize loop, the loop counter may overflow");
 
       if (LOCATION_LINE (loc) > 0)
-	warning (OPT_Wunsafe_loop_optimizations, "%H%s", &loc, gettext (wording));
+	warning (OPT_Wunsafe_loop_optimizations, "%H%s", loc, gettext (wording));
       else
 	warning (OPT_Wunsafe_loop_optimizations, "%s", gettext (wording));
     }
Index: java/jcf-parse.c
===================================================================
--- java/jcf-parse.c	(revision 146626)
+++ java/jcf-parse.c	(working copy)
@@ -1509,7 +1509,7 @@ duplicate_class_warning (const char *fil
   location_t warn_loc;
   linemap_add (line_table, LC_RENAME, 0, filename, 0);
   warn_loc = linemap_line_start (line_table, 0, 1);
-  warning (0, "%Hduplicate class will only be compiled once", &warn_loc);
+  warning (0, "%Hduplicate class will only be compiled once", warn_loc);
 }
 
 static void
Index: c-lex.c
===================================================================
--- c-lex.c	(revision 146626)
+++ c-lex.c	(working copy)
@@ -265,7 +265,7 @@ cb_def_pragma (cpp_reader *pfile, source
 	}
 
       warning (OPT_Wunknown_pragmas, "%Hignoring #pragma %s %s",
-	       &fe_loc, space, name);
+	       fe_loc, space, name);
     }
 }
 
@@ -379,7 +379,7 @@ c_lex_with_flags (tree *value, location_
 
 	    default:
 	      /* ... or not.  */
-	      error ("%Hstray %<@%> in program", &atloc);
+	      error ("%Hstray %<@%> in program", atloc);
 	      *loc = newloc;
 	      goto retry_after_at;
 	    }
Index: value-prof.c
===================================================================
--- value-prof.c	(revision 146626)
+++ value-prof.c	(working copy)
@@ -475,7 +475,7 @@ check_counter (gimple stmt, const char *
       else
 	{
 	  error ("%HCorrupted value profile: %s profiler overall count (%d) "
-                 "does not match BB count (%d)", &locus, name, (int)*all,
+                 "does not match BB count (%d)", locus, name, (int)*all,
                  (int)bb_count);
 	  return true;
 	}
Index: tree.c
===================================================================
--- tree.c	(revision 146626)
+++ tree.c	(working copy)
@@ -3566,19 +3566,6 @@ expand_location (source_location loc)
   return xloc;
 }
 
-
-/* Source location accessor functions.  */
-
-
-void
-set_expr_locus (tree node, source_location *loc)
-{
-  if (loc == NULL)
-    EXPR_CHECK (node)->exp.locus = UNKNOWN_LOCATION;
-  else
-    EXPR_CHECK (node)->exp.locus = *loc;
-}
-
 /* Like SET_EXPR_LOCATION, but make sure the tree can have a location.
 
    LOC is the location to use in tree T.  */
Index: tree.h
===================================================================
--- tree.h	(revision 146626)
+++ tree.h	(working copy)
@@ -1540,24 +1540,17 @@ struct GTY(()) tree_constructor {
 /* In a LOOP_EXPR node.  */
 #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
 
-/* The source location of this expression.  Non-tree_exp nodes such as
-   decls and constants can be shared among multiple locations, so
-   return nothing.  */
-#define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
-#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
+/* The source location of this expression.  Non-tree_exp nodes such as decls
+   and constants can be shared among multiple locations so return nothing.  */
+#define EXPR_LOCATION(NODE) \
+  (EXPR_P (NODE) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
+#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK (NODE)->exp.locus = (LOCUS)
 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
-#define EXPR_LOCUS(NODE) (EXPR_P (NODE) \
-			  ? CONST_CAST (source_location *, &(NODE)->exp.locus) \
-			  : (source_location *) NULL)
-#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM))
-#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
+#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK (NODE)->exp.locus)
 #define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
 
-/* True if a tree is an expression or statement that can have a
-   location.  */
-#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE))
-
-extern void protected_set_expr_location (tree, location_t);
+/* True if a tree is an expression or statement that can have a location.  */
+#define CAN_HAVE_LOCATION_P(NODE) EXPR_P (NODE)
 
 /* In a TARGET_EXPR node.  */
 #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
@@ -4880,7 +4873,7 @@ extern tree build_addr (tree, tree);
 extern bool fields_compatible_p (const_tree, const_tree);
 extern tree find_compatible_field (tree, tree);
 
-extern void set_expr_locus (tree, source_location *);
+extern void protected_set_expr_location (tree, location_t);
 
 extern tree *tree_block (tree);
 extern location_t *block_nonartificial_location (tree);
Index: builtins.c
===================================================================
--- builtins.c	(revision 146626)
+++ builtins.c	(working copy)
@@ -10931,7 +10931,7 @@ fold_call_expr (tree exp, bool ignore)
 		 expansion of builtin.  Otherwise things like
 		 maybe_emit_chk_warning, that operate on the expansion
 		 of a builtin, will use the wrong location information.  */
-	      if (CAN_HAVE_LOCATION_P (exp) && EXPR_HAS_LOCATION (exp))
+	      if (EXPR_HAS_LOCATION (exp))
 		{
 		  tree realret = ret;
 		  if (TREE_CODE (ret) == NOP_EXPR)
Index: fold-const.c
===================================================================
--- fold-const.c	(revision 146626)
+++ fold-const.c	(working copy)
@@ -988,7 +988,7 @@ fold_undefer_overflow_warnings (bool iss
     locus = input_location;
   else
     locus = gimple_location (stmt);
-  warning (OPT_Wstrict_overflow, "%H%s", &locus, warnmsg);
+  warning (OPT_Wstrict_overflow, "%H%s", locus, warnmsg);
 }
 
 /* Stop deferring overflow warnings, ignoring any deferred
Index: objc/objc-act.c
===================================================================
--- objc/objc-act.c	(revision 146626)
+++ objc/objc-act.c	(working copy)
@@ -2543,11 +2543,11 @@ build_selector_translation_table (void)
           }
         if (!found)
 	  {
-	    location_t *loc;
+	    location_t loc;
 	    if (flag_next_runtime && TREE_PURPOSE (chain))
-	      loc = &DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
+	      loc = DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
 	    else
-	      loc = &input_location;
+	      loc = input_location;
 	    warning (0, "%Hcreating selector for nonexistent method %qE",
 		     loc, TREE_VALUE (chain));
 	  }
@@ -3622,7 +3622,7 @@ next_sjlj_build_catch_list (void)
 	      cond = c_common_truthvalue_conversion (input_location, t);
 	    }
 	  t = build3 (COND_EXPR, void_type_node, cond, body, NULL);
-	  SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
+	  SET_EXPR_LOCATION (t, EXPR_LOCATION (stmt));
 
 	  *last = t;
 	  last = &COND_EXPR_ELSE (t);
@@ -3829,7 +3829,8 @@ objc_begin_catch_clause (tree decl)
 	      warning (0, "exception of type %<%T%> will be caught",
 		       TREE_TYPE (type));
 	      warning (0, "%H   by earlier handler for %<%T%>",
-		       EXPR_LOCUS (stmt), TREE_TYPE (t ? t : objc_object_type));
+		       EXPR_LOCATION (stmt),
+		       TREE_TYPE (t ? t : objc_object_type));
 	      break;
 	    }
 	}
Index: pretty-print.c
===================================================================
--- pretty-print.c	(revision 146626)
+++ pretty-print.c	(working copy)
@@ -473,9 +473,9 @@ pp_base_format (pretty_printer *pp, text
 
 	case 'H':
 	  {
-	    location_t *locus = va_arg (*text->args_ptr, location_t *);
+	    location_t locus = va_arg (*text->args_ptr, location_t);
 	    gcc_assert (text->locus != NULL);
-	    *text->locus = *locus;
+	    *text->locus = locus;
 	  }
 	  break;
 
Index: testsuite/gcc.dg/format/gcc_diag-1.c
===================================================================
--- testsuite/gcc.dg/format/gcc_diag-1.c	(revision 146626)
+++ testsuite/gcc.dg/format/gcc_diag-1.c	(working copy)
@@ -11,11 +11,7 @@
 
 typedef long long __gcc_host_wide_int__;
 
-typedef struct location_s
-{
-  const char *file;
-  int line;
-} location_t;
+typedef unsigned int location_t;
 
 union tree_node;
 typedef union tree_node *tree;
@@ -31,7 +27,7 @@ foo (int i, int i1, int i2, unsigned int
      long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll,
      ullong ull, unsigned int *un, const int *cn, signed char *ss,
      unsigned char *us, const signed char *css, unsigned int u1,
-     unsigned int u2, location_t *loc, tree t1, union tree_node *t2,
+     unsigned int u2, location_t loc, tree t1, union tree_node *t2,
      tree *t3, tree t4[])
 {
   /* Acceptable C90 specifiers, flags and modifiers.  */
@@ -115,10 +111,10 @@ foo (int i, int i1, int i2, unsigned int
   tdiag ("%J"); /* { dg-warning "format" "missing arg" } */
   cdiag ("%J"); /* { dg-warning "format" "missing arg" } */
   cxxdiag ("%J"); /* { dg-warning "format" "missing arg" } */
-  diag ("%H", i); /* { dg-warning "format" "wrong arg" } */
-  tdiag ("%H", i); /* { dg-warning "format" "wrong arg" } */
-  cdiag ("%H", i); /* { dg-warning "format" "wrong arg" } */
-  cxxdiag ("%H", i); /* { dg-warning "format" "wrong arg" } */
+  diag ("%H", &loc); /* { dg-warning "format" "wrong arg" } */
+  tdiag ("%H", &loc); /* { dg-warning "format" "wrong arg" } */
+  cdiag ("%H", &loc); /* { dg-warning "format" "wrong arg" } */
+  cxxdiag ("%H", &loc); /* { dg-warning "format" "wrong arg" } */
   diag ("%H", p); /* { dg-warning "format" "wrong arg" } */
   tdiag ("%H", p); /* { dg-warning "format" "wrong arg" } */
   cdiag ("%H", p); /* { dg-warning "format" "wrong arg" } */
Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 146626)
+++ cp/decl.c	(working copy)
@@ -2458,7 +2458,7 @@ decl_jump_unsafe (tree decl)
 /* A subroutine of check_previous_goto_1 to identify a branch to the user.  */
 
 static void
-identify_goto (tree decl, const location_t *locus)
+identify_goto (tree decl, const location_t locus)
 {
   if (decl)
     permerror (input_location, "jump to label %qD", decl);
@@ -2476,7 +2476,7 @@ identify_goto (tree decl, const location
 
 static bool
 check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names,
-		       bool exited_omp, const location_t *locus)
+		       bool exited_omp, const location_t locus)
 {
   struct cp_binding_level *b;
   bool identified = false, saw_eh = false, saw_omp = false;
@@ -2545,13 +2545,14 @@ check_previous_goto (tree decl, struct n
 {
   check_previous_goto_1 (decl, use->binding_level,
 			 use->names_in_scope, use->in_omp_scope,
-			 &use->o_goto_locus);
+			 use->o_goto_locus);
 }
 
 static bool
 check_switch_goto (struct cp_binding_level* level)
 {
-  return check_previous_goto_1 (NULL_TREE, level, level->names, false, NULL);
+  return check_previous_goto_1 (NULL_TREE, level, level->names, false,
+				UNKNOWN_LOCATION);
 }
 
 /* Check that a new jump to a label DECL is OK.  Called by
Index: cp/except.c
===================================================================
--- cp/except.c	(revision 146626)
+++ cp/except.c	(working copy)
@@ -998,9 +998,9 @@ check_handlers_1 (tree master, tree_stmt
       if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
 	{
 	  warning (0, "%Hexception of type %qT will be caught",
-		   EXPR_LOCUS (handler), TREE_TYPE (handler));
+		   EXPR_LOCATION (handler), TREE_TYPE (handler));
 	  warning (0, "%H   by earlier handler for %qT",
-		   EXPR_LOCUS (master), type);
+		   EXPR_LOCATION (master), type);
 	  break;
 	}
     }
@@ -1030,7 +1030,7 @@ check_handlers (tree handlers)
 	  break;
 	if (TREE_TYPE (handler) == NULL_TREE)
 	  permerror (input_location, "%H%<...%> handler must be the last handler for"
-		     " its try block", EXPR_LOCUS (handler));
+		     " its try block", EXPR_LOCATION (handler));
 	else
 	  check_handlers_1 (handler, i);
       }
Index: cp/semantics.c
===================================================================
--- cp/semantics.c	(revision 146626)
+++ cp/semantics.c	(working copy)
@@ -2566,19 +2566,19 @@ qualified_name_lookup_error (tree scope,
     {
       if (!COMPLETE_TYPE_P (scope))
 	error ("%Hincomplete type %qT used in nested name specifier",
-	       &location, scope);
+	       location, scope);
       else if (TREE_CODE (decl) == TREE_LIST)
 	{
-	  error ("%Hreference to %<%T::%D%> is ambiguous", &location, scope, name);
+	  error ("%Hreference to %<%T::%D%> is ambiguous", location, scope, name);
 	  print_candidates (decl);
 	}
       else
-	error ("%H%qD is not a member of %qT", &location, name, scope);
+	error ("%H%qD is not a member of %qT", location, name, scope);
     }
   else if (scope != global_namespace)
-    error ("%H%qD is not a member of %qD", &location, name, scope);
+    error ("%H%qD is not a member of %qD", location, name, scope);
   else
-    error ("%H%<::%D%> has not been declared", &location, name);
+    error ("%H%<::%D%> has not been declared", location, name);
 }
 
 /* If FNS is a member function, a set of member functions, or a
@@ -3333,7 +3333,7 @@ finalize_nrv_r (tree* tp, int* walk_subt
       else
 	init = build_empty_stmt ();
       DECL_INITIAL (dp->var) = NULL_TREE;
-      SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp));
+      SET_EXPR_LOCATION (init, EXPR_LOCATION (*tp));
       *tp = init;
     }
   /* And replace all uses of the NRV with the RESULT_DECL.  */
@@ -3976,7 +3976,7 @@ handle_omp_for_class_iterator (int i, lo
     }
   if (cond == error_mark_node)
     {
-      error ("%Hinvalid controlling predicate", &elocus);
+      error ("%Hinvalid controlling predicate", elocus);
       return true;
     }
   diff = build_x_binary_op (MINUS_EXPR, TREE_OPERAND (cond, 1),
@@ -3987,7 +3987,7 @@ handle_omp_for_class_iterator (int i, lo
   if (TREE_CODE (TREE_TYPE (diff)) != INTEGER_TYPE)
     {
       error ("%Hdifference between %qE and %qD does not have integer type",
-	     &elocus, TREE_OPERAND (cond, 1), iter);
+	     elocus, TREE_OPERAND (cond, 1), iter);
       return true;
     }
 
@@ -4081,7 +4081,7 @@ handle_omp_for_class_iterator (int i, lo
 
   if (incr == error_mark_node)
     {
-      error ("%Hinvalid increment expression", &elocus);
+      error ("%Hinvalid increment expression", elocus);
       return true;
     }
 
@@ -4208,7 +4208,7 @@ finish_omp_for (location_t locus, tree d
 	  if (decl == NULL)
 	    {
 	      error ("%Hexpected iteration declaration or initialization",
-		     &locus);
+		     locus);
 	      return NULL;
 	    }
 	}
@@ -4218,13 +4218,13 @@ finish_omp_for (location_t locus, tree d
 
       if (cond == NULL)
 	{
-	  error ("%Hmissing controlling predicate", &elocus);
+	  error ("%Hmissing controlling predicate", elocus);
 	  return NULL;
 	}
 
       if (incr == NULL)
 	{
-	  error ("%Hmissing increment expression", &elocus);
+	  error ("%Hmissing increment expression", elocus);
 	  return NULL;
 	}
 
@@ -4279,7 +4279,7 @@ finish_omp_for (location_t locus, tree d
       if (!DECL_P (decl))
 	{
 	  error ("%Hexpected iteration declaration or initialization",
-		 &elocus);
+		 elocus);
 	  return NULL;
 	}
 
@@ -4304,7 +4304,7 @@ finish_omp_for (location_t locus, tree d
       if (!INTEGRAL_TYPE_P (TREE_TYPE (decl))
 	  && TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE)
 	{
-	  error ("%Hinvalid type for iteration variable %qE", &elocus, decl);
+	  error ("%Hinvalid type for iteration variable %qE", elocus, decl);
 	  return NULL;
 	}
 
Index: cp/parser.c
===================================================================
--- cp/parser.c	(revision 146626)
+++ cp/parser.c	(working copy)
@@ -2075,7 +2075,7 @@ cp_parser_error (cp_parser* parser, cons
 
       if (token->type == CPP_PRAGMA)
 	{
-	  error ("%H%<#pragma%> is not allowed here", &token->location);
+	  error ("%H%<#pragma%> is not allowed here", token->location);
 	  cp_parser_skip_to_pragma_eol (parser, token);
 	  return;
 	}
@@ -2107,25 +2107,25 @@ cp_parser_name_lookup_error (cp_parser*
     {
       if (parser->scope && parser->scope != global_namespace)
 	error ("%H%<%E::%E%> has not been declared",
-	       &location, parser->scope, name);
+	       location, parser->scope, name);
       else if (parser->scope == global_namespace)
-	error ("%H%<::%E%> has not been declared", &location, name);
+	error ("%H%<::%E%> has not been declared", location, name);
       else if (parser->object_scope
 	       && !CLASS_TYPE_P (parser->object_scope))
 	error ("%Hrequest for member %qE in non-class type %qT",
-	       &location, name, parser->object_scope);
+	       location, name, parser->object_scope);
       else if (parser->object_scope)
 	error ("%H%<%T::%E%> has not been declared",
-	       &location, parser->object_scope, name);
+	       location, parser->object_scope, name);
       else
-	error ("%H%qE has not been declared", &location, name);
+	error ("%H%qE has not been declared", location, name);
     }
   else if (parser->scope && parser->scope != global_namespace)
-    error ("%H%<%E::%E%> %s", &location, parser->scope, name, desired);
+    error ("%H%<%E::%E%> %s", location, parser->scope, name, desired);
   else if (parser->scope == global_namespace)
-    error ("%H%<::%E%> %s", &location, name, desired);
+    error ("%H%<::%E%> %s", location, name, desired);
   else
-    error ("%H%qE %s", &location, name, desired);
+    error ("%H%qE %s", location, name, desired);
 }
 
 /* If we are parsing tentatively, remember that an error has occurred
@@ -2160,7 +2160,7 @@ cp_parser_check_decl_spec (cp_decl_speci
       if (ds == ds_long)
 	{
 	  if (count > 2)
-	    error ("%H%<long long long%> is too long for GCC", &location);
+	    error ("%H%<long long long%> is too long for GCC", location);
 	  else 
 	    pedwarn_cxx98 (location, OPT_Wlong_long, 
 			   "ISO C++ 1998 does not support %<long long%>");
@@ -2183,7 +2183,7 @@ cp_parser_check_decl_spec (cp_decl_speci
 	    "__complex",
 	    "__thread"
 	  };
-	  error ("%Hduplicate %qs", &location, decl_spec_names[(int)ds]);
+	  error ("%Hduplicate %qs", location, decl_spec_names[(int)ds]);
 	}
     }
 }
@@ -2227,7 +2227,7 @@ cp_parser_check_for_definition_in_return
   if (declarator
       && declarator->kind == cdk_function)
     {
-      error ("%Hnew types may not be defined in a return type", &type_location);
+      error ("%Hnew types may not be defined in a return type", type_location);
       inform (type_location, 
 	      "(perhaps a semicolon is missing after the definition of %qT)",
 	      type);
@@ -2249,11 +2249,11 @@ cp_parser_check_for_invalid_template_id
   if (cp_lexer_next_token_is (parser->lexer, CPP_LESS))
     {
       if (TYPE_P (type))
-	error ("%H%qT is not a template", &location, type);
+	error ("%H%qT is not a template", location, type);
       else if (TREE_CODE (type) == IDENTIFIER_NODE)
-	error ("%H%qE is not a template", &location, type);
+	error ("%H%qE is not a template", location, type);
       else
-	error ("%Hinvalid template-id", &location);
+	error ("%Hinvalid template-id", location);
       /* Remember the location of the invalid "<".  */
       if (cp_parser_uncommitted_to_tentative_parse_p (parser))
 	start = cp_lexer_token_position (parser->lexer, true);
@@ -2316,17 +2316,16 @@ cp_parser_diagnose_invalid_type_name (cp
   to specify an argument list. Emit a useful error message.  */
   if (TREE_CODE (decl) == TEMPLATE_DECL)
     error ("%Hinvalid use of template-name %qE without an argument list",
-           &location, decl);
+           location, decl);
   else if (TREE_CODE (id) == BIT_NOT_EXPR)
-    error ("%Hinvalid use of destructor %qD as a type", &location, id);
+    error ("%Hinvalid use of destructor %qD as a type", location, id);
   else if (TREE_CODE (decl) == TYPE_DECL)
     /* Something like 'unsigned A a;'  */
-    error ("%Hinvalid combination of multiple type-specifiers",
-           &location);
+    error ("%Hinvalid combination of multiple type-specifiers", location);
   else if (!parser->scope)
     {
       /* Issue an error message.  */
-      error ("%H%qE does not name a type", &location, id);
+      error ("%H%qE does not name a type", location, id);
       /* If we're in a template class, it's possible that the user was
 	 referring to a type from a base class.  For example:
 
@@ -2375,10 +2374,10 @@ cp_parser_diagnose_invalid_type_name (cp
     {
       if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
 	error ("%H%qE in namespace %qE does not name a type",
-	       &location, id, parser->scope);
+	       location, id, parser->scope);
       else if (TYPE_P (parser->scope))
 	error ("%H%qE in class %qT does not name a type",
-               &location, id, parser->scope);
+               location, id, parser->scope);
       else
 	gcc_unreachable ();
     }
@@ -2942,7 +2941,7 @@ cp_parser_string_literal (cp_parser *par
 		type = tok->type;
 	      else if (tok->type != CPP_STRING)
 		error ("%Hunsupported non-standard concatenation "
-                       "of string literals", &tok->location);
+                       "of string literals", tok->location);
 	    }
 
 	  obstack_grow (&str_ob, &str, sizeof (cpp_string));
@@ -3145,7 +3144,7 @@ cp_parser_primary_expression (cp_parser
       if (TREE_CODE (token->u.value) == FIXED_CST)
 	{
 	  error ("%Hfixed-point types not supported in C++",
-		 &token->location);
+		 token->location);
 	  return error_mark_node;
 	}
       /* Floating-point literals are only allowed in an integral
@@ -3238,7 +3237,7 @@ cp_parser_primary_expression (cp_parser
 	      {
 		error ("%Hstatement-expressions are not allowed outside "
 		       "functions nor in template-argument lists",
-		       &token->location);
+		       token->location);
 		cp_parser_skip_to_end_of_block_or_statement (parser);
 		expr = error_mark_node;
 	      }
@@ -3296,7 +3295,7 @@ cp_parser_primary_expression (cp_parser
 	  if (parser->local_variables_forbidden_p)
 	    {
 	      error ("%H%<this%> may not be used in this context",
-                     &token->location);
+                     token->location);
 	      return error_mark_node;
 	    }
 	  /* Pointers cannot appear in constant-expressions.  */
@@ -3505,7 +3504,7 @@ cp_parser_primary_expression (cp_parser
 		if (local_variable_p (decl))
 		  {
 		    error ("%Hlocal variable %qD may not appear in this context",
-			   &id_expr_token->location, decl);
+			   id_expr_token->location, decl);
 		    return error_mark_node;
 		  }
 	      }
@@ -3805,7 +3804,7 @@ cp_parser_unqualified_id (cp_parser* par
 	  {
 	    if (!cp_parser_uncommitted_to_tentative_parse_p (parser))
 	      error ("%Hscope %qT before %<~%> is not a class-name",
-		     &token->location, scope);
+		     token->location, scope);
 	    cp_parser_simulate_error (parser);
 	    if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
 	      cp_lexer_consume_token (parser->lexer);
@@ -3919,7 +3918,7 @@ cp_parser_unqualified_id (cp_parser* par
 	  {
 	    if (!cp_parser_uncommitted_to_tentative_parse_p (parser))
 	      error ("%Hdeclaration of %<~%T%> as member of %qT",
-		     &token->location, type_decl, scope);
+		     token->location, type_decl, scope);
 	    cp_parser_simulate_error (parser);
 	    return error_mark_node;
 	  }
@@ -3933,7 +3932,7 @@ cp_parser_unqualified_id (cp_parser* par
 	    && !DECL_SELF_REFERENCE_P (type_decl)
 	    && !cp_parser_uncommitted_to_tentative_parse_p (parser))
 	  error ("%Htypedef-name %qD used as destructor declarator",
-		 &token->location, type_decl);
+		 token->location, type_decl);
 
 	return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
       }
@@ -4147,11 +4146,11 @@ cp_parser_nested_name_specifier_opt (cp_
 						    token->location);
 		      if (TREE_CODE (decl) == TEMPLATE_DECL)
 			error ("%H%qD used without template parameters",
-			       &token->location, decl);
+			       token->location, decl);
 		      else if (ambiguous_decls)
 			{
 			  error ("%Hreference to %qD is ambiguous",
-				 &token->location, token->u.value);
+				 token->location, token->u.value);
 			  print_candidates (ambiguous_decls);
 			  decl = error_mark_node;
 			}
@@ -4993,7 +4992,7 @@ cp_parser_postfix_dot_deref_expression (
       /* The type of the POSTFIX_EXPRESSION must be complete.  */
       if (scope == unknown_type_node)
 	{
-	  error ("%H%qE does not have class type", &location, postfix_expression);
+	  error ("%H%qE does not have class type", location, postfix_expression);
 	  scope = NULL_TREE;
 	}
       else
@@ -5077,7 +5076,7 @@ cp_parser_postfix_dot_deref_expression (
 	 TYPE_DECL here.  That is invalid code.  */
       if (TREE_CODE (name) == TYPE_DECL)
 	{
-	  error ("%Hinvalid use of %qD", &token->location, name);
+	  error ("%Hinvalid use of %qD", token->location, name);
 	  postfix_expression = error_mark_node;
 	}
       else
@@ -5657,7 +5656,7 @@ cp_parser_new_expression (cp_parser* par
       if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
 	{
 	  error ("%Harray bound forbidden after parenthesized type-id",
-		 &token->location);
+		 token->location);
 	  inform (token->location, 
 		  "try removing the parentheses around the type-id");
 	  cp_parser_direct_new_declarator (parser);
@@ -5853,7 +5852,7 @@ cp_parser_direct_new_declarator (cp_pars
 	      if (!expression)
 		{
 		  error ("%Hexpression in new-declarator must have integral "
-			 "or enumeration type", &token->location);
+			 "or enumeration type", token->location);
 		  expression = error_mark_node;
 		}
 	    }
@@ -6240,7 +6239,7 @@ cp_parser_binary_expression (cp_parser*
         {
           warning (OPT_Wc__0x_compat, 
                    "%H%<>>%> operator will be treated as two right angle brackets in C++0x", 
-                   &token->location);
+                   token->location);
           warning (OPT_Wc__0x_compat, 
                    "suggest parentheses around %<>>%> expression");
         }
@@ -7080,7 +7079,7 @@ cp_parser_label_for_labeled_statement (c
 	  finish_case_label (expr, expr_hi);
 	else
 	  error ("%Hcase label %qE not within a switch statement",
-		 &token->location, expr);
+		 token->location, expr);
       }
       break;
 
@@ -7091,7 +7090,7 @@ cp_parser_label_for_labeled_statement (c
       if (parser->in_switch_statement_p)
 	finish_case_label (NULL_TREE, NULL_TREE);
       else
-	error ("%Hcase label not within a switch statement", &token->location);
+	error ("%Hcase label not within a switch statement", token->location);
       break;
 
     default:
@@ -7209,7 +7208,7 @@ cp_parser_statement_seq_opt (cp_parser*
 	  else
 	    {
 	      token = cp_lexer_consume_token (parser->lexer);
-	      error ("%H%<else%> without a previous %<if%>", &token->location);
+	      error ("%H%<else%> without a previous %<if%>", token->location);
 	    }
 	}
 
@@ -7340,7 +7339,7 @@ cp_parser_selection_statement (cp_parser
 		  warning (OPT_Wparentheses,
 			   ("%Hsuggest explicit braces "
 			    "to avoid ambiguous %<else%>"),
-			   EXPR_LOCUS (statement));
+			   EXPR_LOCATION (statement));
 	      }
 
 	    /* Now we're all done with the if-statement.  */
@@ -7688,7 +7687,7 @@ cp_parser_jump_statement (cp_parser* par
       switch (in_statement)
 	{
 	case 0:
-	  error ("%Hbreak statement not within loop or switch", &token->location);
+	  error ("%Hbreak statement not within loop or switch", token->location);
 	  break;
 	default:
 	  gcc_assert ((in_statement & IN_SWITCH_STMT)
@@ -7696,10 +7695,10 @@ cp_parser_jump_statement (cp_parser* par
 	  statement = finish_break_stmt ();
 	  break;
 	case IN_OMP_BLOCK:
-	  error ("%Hinvalid exit from OpenMP structured block", &token->location);
+	  error ("%Hinvalid exit from OpenMP structured block", token->location);
 	  break;
 	case IN_OMP_FOR:
-	  error ("%Hbreak statement used with OpenMP for loop", &token->location);
+	  error ("%Hbreak statement used with OpenMP for loop", token->location);
 	  break;
 	}
       cp_parser_require (parser, CPP_SEMICOLON, "%<;%>");
@@ -7709,14 +7708,14 @@ cp_parser_jump_statement (cp_parser* par
       switch (parser->in_statement & ~(IN_SWITCH_STMT | IN_IF_STMT))
 	{
 	case 0:
-	  error ("%Hcontinue statement not within a loop", &token->location);
+	  error ("%Hcontinue statement not within a loop", token->location);
 	  break;
 	case IN_ITERATION_STMT:
 	case IN_OMP_FOR:
 	  statement = finish_continue_stmt ();
 	  break;
 	case IN_OMP_BLOCK:
-	  error ("%Hinvalid exit from OpenMP structured block", &token->location);
+	  error ("%Hinvalid exit from OpenMP structured block", token->location);
 	  break;
 	default:
 	  gcc_unreachable ();
@@ -8117,7 +8116,7 @@ cp_parser_block_declaration (cp_parser *
   else if (token1->keyword == RID_LABEL)
     {
       cp_lexer_consume_token (parser->lexer);
-      error ("%H%<__label__%> not at the beginning of a block", &token1->location);
+      error ("%H%<__label__%> not at the beginning of a block", token1->location);
       cp_parser_skip_to_end_of_statement (parser);
       /* If the next token is now a `;', consume it.  */
       if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
@@ -8255,7 +8254,7 @@ cp_parser_simple_declaration (cp_parser*
 	    {
 	      cp_token *token = cp_lexer_peek_token (parser->lexer);
 	      error ("%Hmixing declarations and function-definitions is forbidden",
-		     &token->location);
+		     token->location);
 	    }
 	  /* Otherwise, we're done with the list of declarators.  */
 	  else
@@ -8394,7 +8393,7 @@ cp_parser_decl_specifier_seq (cp_parser*
 	case RID_FRIEND:
 	  if (!at_class_scope_p ())
 	    {
-	      error ("%H%<friend%> used outside of class", &token->location);
+	      error ("%H%<friend%> used outside of class", token->location);
 	      cp_lexer_purge_token (parser->lexer);
 	    }
 	  else
@@ -8451,7 +8450,7 @@ cp_parser_decl_specifier_seq (cp_parser*
               warning 
                 (OPT_Wc__0x_compat, 
                  "%H%<auto%> will change meaning in C++0x; please remove it",
-		 &token->location);
+		 token->location);
 
               /* Set the storage class anyway.  */
               cp_parser_set_storage_class (parser, decl_specs, RID_AUTO,
@@ -8570,7 +8569,7 @@ cp_parser_decl_specifier_seq (cp_parser*
   if (decl_specs->specs[(int) ds_friend] != 0
       && (*declares_class_or_enum & 2))
     error ("%Hclass definition may not be declared a friend",
-	    &start_token->location);
+	    start_token->location);
 }
 
 /* Parse an (optional) storage-class-specifier.
@@ -8639,7 +8638,7 @@ cp_parser_function_specifier_opt (cp_par
 
 	 A member function template shall not be virtual.  */
       if (PROCESSING_REAL_TEMPLATE_DECL_P ())
-	error ("%Htemplates may not be %<virtual%>", &token->location);
+	error ("%Htemplates may not be %<virtual%>", token->location);
       else if (decl_specs)
 	++decl_specs->specs[(int) ds_virtual];
       break;
@@ -9127,7 +9126,7 @@ cp_parser_mem_initializer_list (cp_parse
      mem-initializer-list.  */
   if (!DECL_CONSTRUCTOR_P (current_function_decl))
     error ("%Honly constructors take base initializers",
-	   &token->location);
+	   token->location);
 
   /* Loop through the list.  */
   while (true)
@@ -9149,7 +9148,7 @@ cp_parser_mem_initializer_list (cp_parse
               && !TYPE_P (TREE_PURPOSE (mem_initializer)))
             {
               error ("%Hcannot expand initializer for member %<%D%>",
-                     &token->location, TREE_PURPOSE (mem_initializer));
+                     token->location, TREE_PURPOSE (mem_initializer));
               mem_initializer = error_mark_node;
             }
 
@@ -9265,7 +9264,7 @@ cp_parser_mem_initializer_id (cp_parser*
     {
       error ("%Hkeyword %<typename%> not allowed in this context (a qualified "
 	     "member initializer is implicitly a type)",
-	     &token->location);
+	     token->location);
       cp_lexer_consume_token (parser->lexer);
     }
   /* Look for the optional `::' operator.  */
@@ -9784,19 +9783,19 @@ cp_parser_template_parameter (cp_parser*
       /* Consume the `='.  */
       cp_token *start_token = cp_lexer_peek_token (parser->lexer);
       cp_lexer_consume_token (parser->lexer);
-      
+
       /* Find the name of the parameter pack.  */     
       id_declarator = parameter_declarator->declarator;
       while (id_declarator && id_declarator->kind != cdk_id)
 	id_declarator = id_declarator->declarator;
-      
+
       if (id_declarator && id_declarator->kind == cdk_id)
 	error ("%Htemplate parameter pack %qD cannot have a default argument",
-	       &start_token->location, id_declarator->u.id.unqualified_name);
+	       start_token->location, id_declarator->u.id.unqualified_name);
       else
 	error ("%Htemplate parameter pack cannot have a default argument",
-	       &start_token->location);
-      
+	       start_token->location);
+
       /* Parse the default argument, but throw away the result.  */
       cp_parser_default_argument (parser, /*template_parm_p=*/true);
     }
@@ -9890,10 +9889,10 @@ cp_parser_type_parameter (cp_parser* par
               {
                 if (identifier)
                   error ("%Htemplate parameter pack %qD cannot have a "
-			 "default argument", &token->location, identifier);
+			 "default argument", token->location, identifier);
                 else
                   error ("%Htemplate parameter packs cannot have "
-			 "default arguments", &token->location);
+			 "default arguments", token->location);
                 default_argument = NULL_TREE;
               }
 	    pop_deferring_access_checks ();
@@ -9997,11 +9996,11 @@ cp_parser_type_parameter (cp_parser* par
                 if (identifier)
                   error ("%Htemplate parameter pack %qD cannot "
 			 "have a default argument",
-			 &token->location, identifier);
+			 token->location, identifier);
                 else
                   error ("%Htemplate parameter packs cannot "
 			 "have default arguments",
-			 &token->location);
+			 token->location);
                 default_argument = NULL_TREE;
               }
 	    pop_deferring_access_checks ();
@@ -10224,7 +10223,7 @@ cp_parser_template_id (cp_parser *parser
 	 failed?  */
       if (cp_parser_error_occurred (parser) && template_id != error_mark_node)
 	error ("%Hparse error in template argument list",
-	       &token->location);
+	       token->location);
     }
 
   pop_deferring_access_checks ();
@@ -10339,7 +10338,7 @@ cp_parser_template_name (cp_parser* pars
 
 	  /* Explain what went wrong.  */
 	  error ("%Hnon-template %qD used as template",
-		 &token->location, identifier);
+		 token->location, identifier);
 	  inform (input_location, "use %<%T::template %D%> to indicate that it is a template",
 		  parser->scope, identifier);
 	  /* If parsing tentatively, find the location of the "<" token.  */
@@ -10474,7 +10473,7 @@ cp_parser_template_argument_list (cp_par
 	    {
 	      cp_token *token = cp_lexer_peek_token (parser->lexer);
 	      error ("%Hexpected parameter pack before %<...%>",
-		     &token->location);
+		     token->location);
 	    }
           /* Consume the `...' token. */
           cp_lexer_consume_token (parser->lexer);
@@ -10883,7 +10882,7 @@ cp_parser_explicit_specialization (cp_pa
      linkage.  */
   if (current_lang_name == lang_name_c)
     {
-      error ("%Htemplate specialization with C linkage", &token->location);
+      error ("%Htemplate specialization with C linkage", token->location);
       /* Give it C++ linkage to avoid confusing other parts of the
 	 front end.  */
       push_lang_context (lang_name_cplusplus);
@@ -12075,7 +12074,7 @@ cp_parser_namespace_name (cp_parser* par
       || TREE_CODE (namespace_decl) != NAMESPACE_DECL)
     {
       if (!cp_parser_uncommitted_to_tentative_parse_p (parser))
-	error ("%H%qD is not a namespace-name", &token->location, identifier);
+	error ("%H%qD is not a namespace-name", token->location, identifier);
       cp_parser_error (parser, "expected namespace-name");
       namespace_decl = error_mark_node;
     }
@@ -12202,7 +12201,7 @@ cp_parser_namespace_alias_definition (cp
   if (!cp_parser_uncommitted_to_tentative_parse_p (parser)
       && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) 
     {
-      error ("%H%<namespace%> definition is not allowed here", &token->location);
+      error ("%H%<namespace%> definition is not allowed here", token->location);
       /* Skip the definition.  */
       cp_lexer_consume_token (parser->lexer);
       if (cp_parser_skip_to_closing_brace (parser))
@@ -12343,7 +12342,7 @@ cp_parser_using_declaration (cp_parser*
 
        A using declaration shall not name a template-id.  */
     error ("%Ha template-id may not appear in a using-declaration",
-            &token->location);
+            token->location);
   else
     {
       if (at_class_scope_p ())
@@ -12721,10 +12720,10 @@ cp_parser_init_declarator (cp_parser* pa
 	  if (asm_specification)
 	    error ("%Han asm-specification is not allowed "
 		   "on a function-definition",
-		   &asm_spec_start_token->location);
+		   asm_spec_start_token->location);
 	  if (attributes)
 	    error ("%Hattributes are not allowed on a function-definition",
-		   &attributes_start_token->location);
+		   attributes_start_token->location);
 	  /* This is a function-definition.  */
 	  *function_definition_p = true;
 
@@ -12877,7 +12876,7 @@ cp_parser_init_declarator (cp_parser* pa
 		  consume the initializer.  */
 	       if (decl != error_mark_node)
 		 error ("%Hinitializer provided for function",
-			&initializer_start_token->location);
+			initializer_start_token->location);
 	       cp_parser_skip_to_closing_parenthesis (parser,
 						      /*recovering=*/true,
 						      /*or_comma=*/false,
@@ -13304,7 +13303,7 @@ cp_parser_direct_declarator (cp_parser*
 	      else if (!parser->in_function_body)
 		{
 		  error ("%Harray bound is not an integer constant",
-			 &token->location);
+			 token->location);
 		  bounds = error_mark_node;
 		}
 	    }
@@ -13416,7 +13415,7 @@ cp_parser_direct_declarator (cp_parser*
 	      /* If that failed, the declarator is invalid.  */
 	      if (TREE_CODE (type) == TYPENAME_TYPE)
 		error ("%H%<%T::%E%> is not a type",
-		       &declarator_id_start_token->location,
+		       declarator_id_start_token->location,
 		       TYPE_CONTEXT (qualifying_scope),
 		       TYPE_IDENTIFIER (qualifying_scope));
 	      qualifying_scope = type;
@@ -13443,7 +13442,7 @@ cp_parser_direct_declarator (cp_parser*
 			  && CLASSTYPE_USE_TEMPLATE (name_type))
 			{
 			  error ("%Hinvalid use of constructor as a template",
-				 &declarator_id_start_token->location);
+				 declarator_id_start_token->location);
 			  inform (input_location, "use %<%T::%D%> instead of %<%T::%D%> to "
 				  "name the constructor in a qualified name",
 				  class_type,
@@ -13617,7 +13616,7 @@ cp_parser_ptr_operator (cp_parser* parse
 	  code = INDIRECT_REF;
 
 	  if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
-	    error ("%H%qD is a namespace", &token->location, parser->scope);
+	    error ("%H%qD is a namespace", token->location, parser->scope);
 	  else
 	    {
 	      /* The type of which the member is a member is given by the
@@ -13692,7 +13691,7 @@ cp_parser_cv_qualifier_seq_opt (cp_parse
 
       if (cv_quals & cv_qualifier)
 	{
-	  error ("%Hduplicate cv-qualifier", &token->location);
+	  error ("%Hduplicate cv-qualifier", token->location);
 	  cp_lexer_purge_token (parser->lexer);
 	}
       else
@@ -14389,7 +14388,7 @@ cp_parser_parameter_declaration (cp_pars
 		  /* If we run out of tokens, issue an error message.  */
 		case CPP_EOF:
 		case CPP_PRAGMA_EOL:
-		  error ("%Hfile ends in default argument", &token->location);
+		  error ("%Hfile ends in default argument", token->location);
 		  done = true;
 		  break;
 
@@ -14440,7 +14439,7 @@ cp_parser_parameter_declaration (cp_pars
 	    {
 	      error ("%Hdefault arguments are only "
 		     "permitted for function parameters",
-		     &token->location);
+		     token->location);
 	      default_argument = NULL_TREE;
 	    }
 	}
@@ -14457,11 +14456,11 @@ cp_parser_parameter_declaration (cp_pars
 	  
 	  if (id_declarator && id_declarator->kind == cdk_id)
 	    error ("%H%sparameter pack %qD cannot have a default argument",
-		   &declarator_token_start->location,
+		   declarator_token_start->location,
 		   kind, id_declarator->u.id.unqualified_name);
 	  else
 	    error ("%H%sparameter pack cannot have a default argument",
-		   &declarator_token_start->location, kind);
+		   declarator_token_start->location, kind);
 	  
 	  default_argument = NULL_TREE;
 	}
@@ -14877,7 +14876,7 @@ cp_parser_class_name (cp_parser *parser,
 	  if (ambiguous_decls)
 	    {
 	      error ("%Hreference to %qD is ambiguous",
-		     &identifier_token->location, identifier);
+		     identifier_token->location, identifier);
 	      print_candidates (ambiguous_decls);
 	      if (cp_parser_parsing_tentatively (parser))
 		{
@@ -15343,7 +15342,7 @@ cp_parser_class_head (cp_parser* parser,
       if (!DECL_IMPLICIT_TYPEDEF_P (type))
 	{
 	  error ("%Hinvalid class name in declaration of %qD",
-		 &type_start_token->location, type);
+		 type_start_token->location, type);
 	  type = NULL_TREE;
 	  goto done;
 	}
@@ -15357,11 +15356,11 @@ cp_parser_class_head (cp_parser* parser,
 	  if (at_namespace_scope_p ())
 	    error ("%Hdeclaration of %qD in namespace %qD which does not "
 		   "enclose %qD",
-		   &type_start_token->location,
+		   type_start_token->location,
 		   type, scope, nested_name_specifier);
 	  else
 	    error ("%Hdeclaration of %qD in %qD which does not enclose %qD",
-		   &type_start_token->location,
+		   type_start_token->location,
 		   type, scope, nested_name_specifier);
 	  type = NULL_TREE;
 	  goto done;
@@ -15375,7 +15374,7 @@ cp_parser_class_head (cp_parser* parser,
       if (scope == nested_name_specifier)
 	{
 	  permerror (input_location, "%Hextra qualification not allowed",
-		     &nested_name_specifier_token_start->location);
+		     nested_name_specifier_token_start->location);
 	  nested_name_specifier = NULL_TREE;
 	  num_templates = 0;
 	}
@@ -15387,7 +15386,7 @@ cp_parser_class_head (cp_parser* parser,
       && template_id_p)
     {
       error ("%Han explicit specialization must be preceded by %<template <>%>",
-	     &type_start_token->location);
+	     type_start_token->location);
       invalid_explicit_specialization_p = true;
       /* Take the same action that would have been taken by
 	 cp_parser_explicit_specialization.  */
@@ -15417,7 +15416,7 @@ cp_parser_class_head (cp_parser* parser,
 	      || TREE_CODE (TREE_OPERAND (id, 0)) == OVERLOAD))
 	{
 	  error ("%Hfunction template %qD redeclared as a class template",
-		 &type_start_token->location, id);
+		 type_start_token->location, id);
 	  type = error_mark_node;
 	}
       else
@@ -15499,9 +15498,9 @@ cp_parser_class_head (cp_parser* parser,
   if (type != error_mark_node && COMPLETE_TYPE_P (type))
     {
       error ("%Hredefinition of %q#T",
-	     &type_start_token->location, type);
+	     type_start_token->location, type);
       error ("%Hprevious definition of %q+#T",
-	     &type_start_token->location, type);
+	     type_start_token->location, type);
       type = NULL_TREE;
       goto done;
     }
@@ -15769,7 +15768,7 @@ cp_parser_member_declaration (cp_parser*
 		 be introduced with a class-key.  */
 	       if (!declares_class_or_enum)
 		 error ("%Ha class-key must be used when declaring a friend",
-                        &decl_spec_token_start->location);
+                        decl_spec_token_start->location);
 	       /* In this case:
 
 		    template <typename T> struct A {
@@ -15784,7 +15783,7 @@ cp_parser_member_declaration (cp_parser*
 		 type = decl_specifiers.type;
 	       if (!type || !TYPE_P (type))
 		 error ("%Hfriend declaration does not name a class or "
-			"function", &decl_spec_token_start->location);
+			"function", decl_spec_token_start->location);
 	       else
 		 make_friend_class (current_class_type, type,
 				    /*complain=*/true);
@@ -15964,7 +15963,7 @@ cp_parser_member_declaration (cp_parser*
 		     outside of the class-specifier.  */
 		  if (initializer)
 		    error ("%Hpure-specifier on function-definition",
-			   &initializer_token_start->location);
+			   initializer_token_start->location);
 		  decl = cp_parser_save_member_function_body (parser,
 							      &decl_specifiers,
 							      declarator,
@@ -16072,7 +16071,7 @@ cp_parser_pure_specifier (cp_parser* par
     }
   if (PROCESSING_REAL_TEMPLATE_DECL_P ())
     {
-      error ("%Htemplates may not be %<virtual%>", &token->location);
+      error ("%Htemplates may not be %<virtual%>", token->location);
       return error_mark_node;
     }
 
@@ -16277,11 +16276,11 @@ cp_parser_base_specifier (cp_parser* par
       token = cp_lexer_peek_token (parser->lexer);
       if (!processing_template_decl)
 	error ("%Hkeyword %<typename%> not allowed outside of templates",
-	       &token->location);
+	       token->location);
       else
 	error ("%Hkeyword %<typename%> not allowed in this context "
 	       "(the base class is implicitly a type)",
-	       &token->location);
+	       token->location);
       cp_lexer_consume_token (parser->lexer);
     }
 
@@ -17169,7 +17168,7 @@ cp_parser_lookup_name (cp_parser *parser
       if (!cp_parser_simulate_error (parser))
 	{
 	  error ("%Hreference to %qD is ambiguous",
-		 &name_location, name);
+		 name_location, name);
 	  print_candidates (decl);
 	}
       return error_mark_node;
@@ -17369,7 +17368,7 @@ cp_parser_check_template_parameters (cp_
      something like:
 
      template <class T> template <class U> void S::f();  */
-  error ("%Htoo many template-parameter-lists", &location);
+  error ("%Htoo many template-parameter-lists", location);
   return false;
 }
 
@@ -17644,7 +17643,7 @@ cp_parser_function_definition_after_decl
       cp_parser_identifier (parser);
       /* Issue an error message.  */
       error ("%Hnamed return values are no longer supported",
-	     &token->location);
+	     token->location);
       /* Skip tokens until we reach the start of the function body.  */
       while (true)
 	{
@@ -17719,7 +17718,7 @@ cp_parser_template_declaration_after_exp
 
          A local class shall not have member templates.  */
       error ("%Hinvalid declaration of member template in local class",
-	     &token->location);
+	     token->location);
       cp_parser_skip_to_end_of_block_or_statement (parser);
       return;
     }
@@ -17728,7 +17727,7 @@ cp_parser_template_declaration_after_exp
      A template ... shall not have C linkage.  */
   if (current_lang_name == lang_name_c)
     {
-      error ("%Htemplate with C linkage", &token->location);
+      error ("%Htemplate with C linkage", token->location);
       /* Give it C++ linkage to avoid confusing other parts of the
 	 front end.  */
       push_lang_context (lang_name_cplusplus);
@@ -17876,7 +17875,7 @@ cp_parser_single_declaration (cp_parser*
   if (decl_specifiers.specs[(int) ds_typedef])
     {
       error ("%Htemplate declaration of %qs",
-	     &decl_spec_token_start->location, "typedef");
+	     decl_spec_token_start->location, "typedef");
       decl = error_mark_node;
     }
 
@@ -17940,7 +17939,7 @@ cp_parser_single_declaration (cp_parser*
         && decl_specifiers.storage_class != sc_none)
       {
         error ("%Hexplicit template specialization cannot have a storage class",
-	       &decl_spec_token_start->location);
+	       decl_spec_token_start->location);
         decl = error_mark_node;
       }
     }
@@ -18159,7 +18158,7 @@ cp_parser_enclosed_template_argument_lis
 	  cp_token *token = cp_lexer_peek_token (parser->lexer);
 	  error ("%H%<>>%> should be %<> >%> "
 		 "within a nested template argument list",
-		 &token->location);
+		 token->location);
 
 	  token->type = CPP_GREATER;
 	}
@@ -18171,7 +18170,7 @@ cp_parser_enclosed_template_argument_lis
 	    right by consuming the '>>' before issuing the diagnostic.  */
 	  cp_token *token = cp_lexer_consume_token (parser->lexer);
 	  error ("%Hspurious %<>>%>, use %<>%> to terminate "
-		 "a template argument list", &token->location);
+		 "a template argument list", token->location);
 	}
     }
   else
@@ -18505,7 +18504,7 @@ cp_parser_set_storage_class (cp_parser *
   if (parser->in_unbraced_linkage_specification_p)
     {
       error ("%Hinvalid use of %qD in linkage specification",
-	     &location, ridpointers[keyword]);
+	     location, ridpointers[keyword]);
       return;
     }
   else if (decl_specs->storage_class != sc_none)
@@ -18517,7 +18516,7 @@ cp_parser_set_storage_class (cp_parser *
   if ((keyword == RID_EXTERN || keyword == RID_STATIC)
       && decl_specs->specs[(int) ds_thread])
     {
-      error ("%H%<__thread%> before %qD", &location, ridpointers[keyword]);
+      error ("%H%<__thread%> before %qD", location, ridpointers[keyword]);
       decl_specs->specs[(int) ds_thread] = 0;
     }
 
@@ -18859,7 +18858,7 @@ cp_parser_check_access_in_redeclaration
        != (current_access_specifier == access_private_node))
       || (TREE_PROTECTED (decl)
 	  != (current_access_specifier == access_protected_node)))
-    error ("%H%qD redeclared with different access", &location, decl);
+    error ("%H%qD redeclared with different access", location, decl);
 }
 
 /* Look for the `template' keyword, as a syntactic disambiguator.
@@ -18878,7 +18877,7 @@ cp_parser_optional_template_keyword (cp_
 	{
 	  cp_token *token = cp_lexer_peek_token (parser->lexer);
 	  error ("%H%<template%> (as a disambiguator) is only allowed "
-		 "within templates", &token->location);
+		 "within templates", token->location);
 	  /* If this part of the token stream is rescanned, the same
 	     error message would be generated.  So, we purge the token
 	     from the stream.  */
@@ -19144,7 +19143,7 @@ cp_parser_objc_expression (cp_parser* pa
 	}
     default:
       error ("%Hmisplaced %<@%D%> Objective-C++ construct",
-	     &kwd->location, kwd->u.value);
+	     kwd->location, kwd->u.value);
       cp_parser_skip_to_end_of_block_or_statement (parser);
     }
 
@@ -19288,7 +19287,7 @@ cp_parser_objc_encode_expression (cp_par
   if (!type)
     {
       error ("%H%<@encode%> must specify a type as an argument",
-	     &token->location);
+	     token->location);
       return error_mark_node;
     }
 
@@ -19603,7 +19602,7 @@ cp_parser_objc_selector (cp_parser* pars
 
   if (!cp_parser_objc_selector_p (token->type))
     {
-      error ("%Hinvalid Objective-C++ selector name", &token->location);
+      error ("%Hinvalid Objective-C++ selector name", token->location);
       return error_mark_node;
     }
 
@@ -19934,7 +19933,7 @@ cp_parser_objc_protocol_declaration (cp_
   if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
     {
       tok = cp_lexer_peek_token (parser->lexer);
-      error ("%Hidentifier expected after %<@protocol%>", &tok->location);
+      error ("%Hidentifier expected after %<@protocol%>", tok->location);
       goto finish;
     }
 
@@ -20071,7 +20070,7 @@ cp_parser_objc_declaration (cp_parser* p
       break;
     default:
       error ("%Hmisplaced %<@%D%> Objective-C++ construct",
-	     &kwd->location, kwd->u.value);
+	     kwd->location, kwd->u.value);
       cp_parser_skip_to_end_of_block_or_statement (parser);
     }
 }
@@ -20203,7 +20202,7 @@ cp_parser_objc_statement (cp_parser * pa
       return cp_parser_objc_throw_statement (parser);
     default:
       error ("%Hmisplaced %<@%D%> Objective-C++ construct",
-	     &kwd->location, kwd->u.value);
+	     kwd->location, kwd->u.value);
       cp_parser_skip_to_end_of_block_or_statement (parser);
     }
 
@@ -20295,7 +20294,7 @@ check_no_duplicate_clause (tree clauses,
   for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c))
     if (OMP_CLAUSE_CODE (c) == code)
       {
-	error ("%Htoo many %qs clauses", &location, name);
+	error ("%Htoo many %qs clauses", location, name);
 	break;
       }
 }
@@ -20410,7 +20409,7 @@ cp_parser_omp_clause_collapse (cp_parser
       || (int) n != n)
     {
       error ("%Hcollapse argument needs positive constant integer expression",
-	     &loc);
+	     loc);
       return list;
     }
 
@@ -20699,10 +20698,10 @@ cp_parser_omp_clause_schedule (cp_parser
 	goto resync_fail;
       else if (OMP_CLAUSE_SCHEDULE_KIND (c) == OMP_CLAUSE_SCHEDULE_RUNTIME)
 	error ("%Hschedule %<runtime%> does not take "
-	       "a %<chunk_size%> parameter", &token->location);
+	       "a %<chunk_size%> parameter", token->location);
       else if (OMP_CLAUSE_SCHEDULE_KIND (c) == OMP_CLAUSE_SCHEDULE_AUTO)
 	error ("%Hschedule %<auto%> does not take "
-	       "a %<chunk_size%> parameter", &token->location);
+	       "a %<chunk_size%> parameter", token->location);
       else
 	OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c) = t;
 
@@ -20849,7 +20848,7 @@ cp_parser_omp_all_clauses (cp_parser *pa
 	  /* Remove the invalid clause(s) from the list to avoid
 	     confusing the rest of the compiler.  */
 	  clauses = prev;
-	  error ("%H%qs is not valid for %qs", &token->location, c_name, where);
+	  error ("%H%qs is not valid for %qs", token->location, c_name, where);
 	}
     }
  saw_error:
@@ -21398,7 +21397,7 @@ cp_parser_omp_for_loop (cp_parser *parse
 		&& OMP_CLAUSE_DECL (*c) == real_decl)
 	      {
 		error ("%Hiteration variable %qD should not be firstprivate",
-		       &loc, real_decl);
+		       loc, real_decl);
 		*c = OMP_CLAUSE_CHAIN (*c);
 	      }
 	    else if (OMP_CLAUSE_CODE (*c) == OMP_CLAUSE_LASTPRIVATE
@@ -21436,11 +21435,11 @@ cp_parser_omp_for_loop (cp_parser *parse
 	      else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE
 		       && OMP_CLAUSE_DECL (c) == decl)
 		error ("%Hiteration variable %qD should not be firstprivate",
-		       &loc, decl);
+		       loc, decl);
 	      else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
 		       && OMP_CLAUSE_DECL (c) == decl)
 		error ("%Hiteration variable %qD should not be reduction",
-		       &loc, decl);
+		       loc, decl);
 	    }
 	  if (c == NULL)
 	    {
@@ -21506,7 +21505,7 @@ cp_parser_omp_for_loop (cp_parser *parse
 	  else
 	    {
 	      loc = cp_lexer_peek_token (parser->lexer)->location;
-	      error ("%Hnot enough collapsed for loops", &loc);
+	      error ("%Hnot enough collapsed for loops", loc);
 	      collapse_err = true;
 	      cp_parser_abort_tentative_parse (parser);
 	      declv = NULL_TREE;
@@ -21552,7 +21551,7 @@ cp_parser_omp_for_loop (cp_parser *parse
 	  if (!collapse_err)
 	    {
 	      location_t loc = cp_lexer_peek_token (parser->lexer)->location;
-	      error ("%Hcollapsed loops not perfectly nested", &loc);
+	      error ("%Hcollapsed loops not perfectly nested", loc);
 	    }
 	  collapse_err = true;
 	  cp_parser_statement_seq_opt (parser, NULL);
@@ -21964,10 +21963,10 @@ cp_parser_initial_pragma (cp_token *firs
       cp_lexer_get_preprocessor_token (NULL, first_token);
       if (first_token->type != CPP_PRAGMA_EOL)
 	error ("%Hjunk at end of %<#pragma GCC pch_preprocess%>",
-               &first_token->location);
+               first_token->location);
     }
   else
-    error ("%Hexpected string literal", &first_token->location);
+    error ("%Hexpected string literal", first_token->location);
 
   /* Skip to the end of the pragma.  */
   while (first_token->type != CPP_PRAGMA_EOL && first_token->type != CPP_EOF)
@@ -22001,7 +22000,7 @@ cp_parser_pragma (cp_parser *parser, enu
     {
     case PRAGMA_GCC_PCH_PREPROCESS:
       error ("%H%<#pragma GCC pch_preprocess%> must be first",
-             &pragma_tok->location);
+             pragma_tok->location);
       break;
 
     case PRAGMA_OMP_BARRIER:
@@ -22012,7 +22011,7 @@ cp_parser_pragma (cp_parser *parser, enu
 	  return false;
 	case pragma_stmt:
 	  error ("%H%<#pragma omp barrier%> may only be "
-		 "used in compound statements", &pragma_tok->location);
+		 "used in compound statements", pragma_tok->location);
 	  break;
 	default:
 	  goto bad_stmt;
@@ -22027,7 +22026,7 @@ cp_parser_pragma (cp_parser *parser, enu
 	  return false;
 	case pragma_stmt:
 	  error ("%H%<#pragma omp flush%> may only be "
-		 "used in compound statements", &pragma_tok->location);
+		 "used in compound statements", pragma_tok->location);
 	  break;
 	default:
 	  goto bad_stmt;
@@ -22043,7 +22042,7 @@ cp_parser_pragma (cp_parser *parser, enu
 	case pragma_stmt:
 	  error ("%H%<#pragma omp taskwait%> may only be "
 		 "used in compound statements",
-		 &pragma_tok->location);
+		 pragma_tok->location);
 	  break;
 	default:
 	  goto bad_stmt;
@@ -22070,7 +22069,7 @@ cp_parser_pragma (cp_parser *parser, enu
 
     case PRAGMA_OMP_SECTION:
       error ("%H%<#pragma omp section%> may only be used in "
-	     "%<#pragma omp sections%> construct", &pragma_tok->location);
+	     "%<#pragma omp sections%> construct", pragma_tok->location);
       break;
 
     default:
Index: c-format.c
===================================================================
--- c-format.c	(revision 146626)
+++ c-format.c	(working copy)
@@ -2612,7 +2612,7 @@ init_dynamic_diag_info (void)
 	{
 	  i = find_char_info_specifier_index (diag_fci, 'H');
 	  diag_fci[i].types[0].type = &loc;
-	  diag_fci[i].pointer_count = 1;
+	  diag_fci[i].pointer_count = 0;
 	}
       if (t)
 	{
@@ -2635,7 +2635,7 @@ init_dynamic_diag_info (void)
 	{
 	  i = find_char_info_specifier_index (tdiag_fci, 'H');
 	  tdiag_fci[i].types[0].type = &loc;
-	  tdiag_fci[i].pointer_count = 1;
+	  tdiag_fci[i].pointer_count = 0;
 	}
       if (t)
 	{
@@ -2662,7 +2662,7 @@ init_dynamic_diag_info (void)
 	{
 	  i = find_char_info_specifier_index (cdiag_fci, 'H');
 	  cdiag_fci[i].types[0].type = &loc;
-	  cdiag_fci[i].pointer_count = 1;
+	  cdiag_fci[i].pointer_count = 0;
 	}
       if (t)
 	{
@@ -2689,7 +2689,7 @@ init_dynamic_diag_info (void)
 	{
 	  i = find_char_info_specifier_index (cxxdiag_fci, 'H');
 	  cxxdiag_fci[i].types[0].type = &loc;
-	  cxxdiag_fci[i].pointer_count = 1;
+	  cxxdiag_fci[i].pointer_count = 0;
 	}
       if (t)
 	{
Index: ada/gcc-interface/trans.c
===================================================================
--- ada/gcc-interface/trans.c	(revision 146626)
+++ ada/gcc-interface/trans.c	(working copy)
@@ -5296,7 +5296,7 @@ gnat_to_gnu (Node_Id gnat_node)
      no result if we tried to build a CALL_EXPR node to a procedure with
      no side-effects and optimization is enabled.  */
   if (gnu_result
-      && EXPR_P (gnu_result)
+      && CAN_HAVE_LOCATION_P (gnu_result)
       && TREE_CODE (gnu_result) != NOP_EXPR
       && !REFERENCE_CLASS_P (gnu_result)
       && !EXPR_HAS_LOCATION (gnu_result))
@@ -5824,7 +5824,7 @@ gnat_gimplify_expr (tree *expr_p, gimple
 
 	  stmt = gimplify_assign (new_var, op, pre_p);
 	  if (EXPR_HAS_LOCATION (op))
-	    gimple_set_location (stmt, *EXPR_LOCUS (op));
+	    gimple_set_location (stmt, EXPR_LOCATION (op));
 
 	  TREE_OPERAND (expr, 0) = new_var;
 	  recompute_tree_invariant_for_addr_expr (expr);
Index: c-decl.c
===================================================================
--- c-decl.c	(revision 146626)
+++ c-decl.c	(working copy)
@@ -2431,17 +2431,17 @@ undeclared_variable (tree id, location_t
 
   if (current_function_decl == 0)
     {
-      error ("%H%qE undeclared here (not in a function)", &loc, id);
+      error ("%H%qE undeclared here (not in a function)", loc, id);
       scope = current_scope;
     }
   else
     {
-      error ("%H%qE undeclared (first use in this function)", &loc, id);
+      error ("%H%qE undeclared (first use in this function)", loc, id);
 
       if (!already)
 	{
-	  error ("%H(Each undeclared identifier is reported only once", &loc);
-	  error ("%Hfor each function it appears in.)", &loc);
+	  error ("%H(Each undeclared identifier is reported only once", loc);
+	  error ("%Hfor each function it appears in.)", loc);
 	  already = true;
 	}
 
@@ -2558,7 +2558,7 @@ define_label (location_t location, tree
 	  || (DECL_CONTEXT (label) != current_function_decl
 	      && C_DECLARED_LABEL_FLAG (label))))
     {
-      error ("%Hduplicate label %qD", &location, label);
+      error ("%Hduplicate label %qD", location, label);
       locate_old_decl (label);
       return 0;
     }
@@ -2586,7 +2586,7 @@ define_label (location_t location, tree
 
   if (!in_system_header && lookup_name (name))
     warning (OPT_Wtraditional, "%Htraditional C lacks a separate namespace "
-	     "for labels, identifier %qE conflicts", &location, name);
+	     "for labels, identifier %qE conflicts", location, name);
 
   nlist_se = XOBNEW (&parser_obstack, struct c_label_list);
   nlist_se->next = label_context_stack_se->labels_def;
@@ -2661,7 +2661,7 @@ pending_xref_error (void)
 {
   if (pending_invalid_xref != 0)
     error ("%H%qE defined as wrong kind of tag",
-	   &pending_invalid_xref_location, pending_invalid_xref);
+	   pending_invalid_xref_location, pending_invalid_xref);
   pending_invalid_xref = 0;
 }
 
@@ -6585,7 +6585,7 @@ store_parm_decls_oldstyle (tree fndecl,
 		{
 		  error ("number of arguments doesn%'t match prototype");
 		  error ("%Hprototype declaration",
-			 &current_function_prototype_locus);
+			 current_function_prototype_locus);
 		}
 	      break;
 	    }
@@ -6637,7 +6637,7 @@ store_parm_decls_oldstyle (tree fndecl,
 		    {
 		      error ("argument %qD doesn%'t match prototype", parm);
 		      error ("%Hprototype declaration",
-			     &current_function_prototype_locus);
+			     current_function_prototype_locus);
 		    }
 		}
 	    }
Index: c-typeck.c
===================================================================
--- c-typeck.c	(revision 146626)
+++ c-typeck.c	(working copy)
@@ -3210,7 +3210,7 @@ build_unary_op (location_t location,
       arg = c_objc_common_truthvalue_conversion (location, arg);
       ret = invert_truthvalue (arg);
       /* If the TRUTH_NOT_EXPR has been folded, reset the location.  */
-      if (EXPR_P (ret) && EXPR_HAS_LOCATION (ret))
+      if (EXPR_HAS_LOCATION (ret))
 	location = EXPR_LOCATION (ret);
       goto return_build_unary_op;
 
@@ -8147,7 +8147,7 @@ c_finish_if_stmt (location_t if_locus, t
       if (COND_EXPR_ELSE (inner_if))
 	 warning (OPT_Wparentheses,
 		  "%Hsuggest explicit braces to avoid ambiguous %<else%>",
-		  &if_locus);
+		  if_locus);
     }
 
   stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block);
@@ -8289,7 +8289,8 @@ emit_side_effect_warnings (tree expr)
     {
       if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
 	warning (OPT_Wunused_value, "%Hstatement with no effect",
-		 EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location);
+		 EXPR_HAS_LOCATION (expr)
+		 ? EXPR_LOCATION (expr) : input_location);
     }
   else
     warn_if_unused_value (expr, input_location);
@@ -8492,7 +8493,7 @@ c_finish_stmt_expr (tree body)
     val = TREE_OPERAND (val, 0);
 
   *last_p = build2 (MODIFY_EXPR, void_type_node, tmp, val);
-  SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last));
+  SET_EXPR_LOCATION (*last_p, EXPR_LOCATION (last));
 
   return build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE);
 }
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 146626)
+++ gimplify.c	(working copy)
@@ -677,7 +677,7 @@ internal_get_tmp_var (tree val, gimple_s
   mod = build2 (INIT_EXPR, TREE_TYPE (t), t, unshare_expr (val));
 
   if (EXPR_HAS_LOCATION (val))
-    SET_EXPR_LOCUS (mod, EXPR_LOCUS (val));
+    SET_EXPR_LOCATION (mod, EXPR_LOCATION (val));
   else
     SET_EXPR_LOCATION (mod, input_location);
 
@@ -898,7 +898,8 @@ static void
 tree_annotate_one_with_location (tree t, location_t location)
 {
   if (CAN_HAVE_LOCATION_P (t)
-      && ! EXPR_HAS_LOCATION (t) && tree_should_carry_location_p (t))
+      && !EXPR_HAS_LOCATION (t)
+      && tree_should_carry_location_p (t))
     SET_EXPR_LOCATION (t, location);
 }
 
@@ -2258,7 +2259,7 @@ gimplify_call_expr (tree *expr_p, gimple
 
   /* For reliable diagnostics during inlining, it is necessary that
      every call_expr be annotated with file and line.  */
-  if (! EXPR_HAS_LOCATION (*expr_p))
+  if (!EXPR_HAS_LOCATION (*expr_p))
     SET_EXPR_LOCATION (*expr_p, input_location);
 
   /* This may be a call to a builtin function.
@@ -2360,7 +2361,7 @@ gimplify_call_expr (tree *expr_p, gimple
 	    = CALL_EXPR_RETURN_SLOT_OPT (call);
 	  CALL_FROM_THUNK_P (*expr_p) = CALL_FROM_THUNK_P (call);
 	  CALL_CANNOT_INLINE_P (*expr_p) = CALL_CANNOT_INLINE_P (call);
-	  SET_EXPR_LOCUS (*expr_p, EXPR_LOCUS (call));
+	  SET_EXPR_LOCATION (*expr_p, EXPR_LOCATION (call));
 	  TREE_BLOCK (*expr_p) = TREE_BLOCK (call);
 
 	  /* Set CALL_EXPR_VA_ARG_PACK.  */
@@ -5357,7 +5358,7 @@ omp_notice_variable (struct gimplify_omp
 	case OMP_CLAUSE_DEFAULT_NONE:
 	  error ("%qs not specified in enclosing parallel",
 		 IDENTIFIER_POINTER (DECL_NAME (decl)));
-	  error ("%Henclosing parallel", &ctx->location);
+	  error ("%Henclosing parallel", ctx->location);
 	  /* FALLTHRU */
 	case OMP_CLAUSE_DEFAULT_SHARED:
 	  flags |= GOVD_SHARED;
@@ -6368,8 +6369,7 @@ gimplify_expr (tree *expr_p, gimple_seq
   post_last_gsi = gsi_last (*post_p);
 
   saved_location = input_location;
-  if (save_expr != error_mark_node
-      && EXPR_HAS_LOCATION (*expr_p))
+  if (save_expr != error_mark_node && EXPR_HAS_LOCATION (*expr_p))
     input_location = EXPR_LOCATION (*expr_p);
 
   /* Loop over the specific gimplifiers until the toplevel node
@@ -7323,7 +7323,7 @@ gimplify_one_sizepos (tree *expr_p, gimp
       tmp = build1 (NOP_EXPR, type, expr);
       stmt = gimplify_assign (*expr_p, tmp, stmt_p);
       if (EXPR_HAS_LOCATION (expr))
-	gimple_set_location (stmt, *EXPR_LOCUS (expr));
+	gimple_set_location (stmt, EXPR_LOCATION (expr));
       else
 	gimple_set_location (stmt, input_location);
     }
Index: c-common.c
===================================================================
--- c-common.c	(revision 146626)
+++ c-common.c	(working copy)
@@ -5577,7 +5577,7 @@ c_do_switch_warnings (splay_tree cases,
   default_node = splay_tree_lookup (cases, (splay_tree_key) NULL);
   if (!default_node)
     warning (OPT_Wswitch_default, "%Hswitch missing default case",
-	     &switch_location);
+	     switch_location);
 
   /* From here on, we only care about about enumerated types.  */
   if (!type || TREE_CODE (type) != ENUMERAL_TYPE)
@@ -5648,7 +5648,7 @@ c_do_switch_warnings (splay_tree cases,
       warning ((default_node || !warn_switch) 
 	       ? OPT_Wswitch_enum : OPT_Wswitch,
 	       "%Henumeration value %qE not handled in switch",
-	       &switch_location, TREE_PURPOSE (chain));
+	       switch_location, TREE_PURPOSE (chain));
     }
 
   /* Warn if there are case expressions that don't correspond to
@@ -8354,11 +8354,11 @@ c_warn_unused_result (gimple_seq seq)
 	      if (fdecl)
 		warning (0, "%Hignoring return value of %qD, "
 			 "declared with attribute warn_unused_result",
-			 &loc, fdecl);
+			 loc, fdecl);
 	      else
 		warning (0, "%Hignoring return value of function "
 			 "declared with attribute warn_unused_result",
-			 &loc);
+			 loc);
 	    }
 	  break;
 
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 146626)
+++ tree-cfg.c	(working copy)
@@ -1532,7 +1532,7 @@ remove_useless_stmts_warn_notreached (gi
           location_t loc = gimple_location (stmt);
           if (LOCATION_LINE (loc) > 0)
 	    {
-              warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
+              warning (OPT_Wunreachable_code, "%Hwill never be executed", loc);
               return true;
             }
         }
@@ -2206,7 +2206,7 @@ remove_bb (basic_block bb)
      loop above, so the last statement we process is the first statement
      in the block.  */
   if (loc > BUILTINS_LOCATION && LOCATION_LINE (loc) > 0)
-    warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
+    warning (OPT_Wunreachable_code, "%Hwill never be executed", loc);
 
   remove_phi_nodes_and_edges_for_unreachable_block (bb);
   bb->il.gimple = NULL;
@@ -7095,7 +7095,7 @@ execute_warn_function_return (void)
 	}
       if (location == UNKNOWN_LOCATION)
 	location = cfun->function_end_locus;
-      warning (0, "%H%<noreturn%> function does return", &location);
+      warning (0, "%H%<noreturn%> function does return", location);
     }
 
   /* If we see "return;" in some basic block, then we do reach the end
Index: stmt.c
===================================================================
--- stmt.c	(revision 146626)
+++ stmt.c	(working copy)
@@ -1466,7 +1466,7 @@ warn_if_unused_value (const_tree exp, lo
 	return 0;
 
     warn:
-      warning (OPT_Wunused_value, "%Hvalue computed is not used", &locus);
+      warning (OPT_Wunused_value, "%Hvalue computed is not used", locus);
       return 1;
     }
 }

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