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] Fix location of command line backend reported issues (PR middle-end/77475)


Hi!

While it would be perhaps nice to pass explicit location_t in the target
option handling code, there are hundreds of error/warning/sorry calls
in lots of backends, and lots of those routines are used not just
for the process_options time (i.e. command line options), but also for
pragma GCC target and target option handling, so at least for the time being
I think it is easier to just use UNKNOWN_LOCATION for the command line
option diagnostics.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-09-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/77475
	* toplev.c (process_options): Temporarily set input_location
	to UNKNOWN_LOCATION around targetm.target_option.override () call.

--- gcc/toplev.c.jj	2016-09-03 11:18:55.000000000 +0200
+++ gcc/toplev.c	2016-09-05 15:05:19.819995470 +0200
@@ -1220,7 +1220,10 @@ process_options (void)
   no_backend = lang_hooks.post_options (&main_input_filename);
 
   /* Some machines may reject certain combinations of options.  */
+  location_t saved_location = input_location;
+  input_location = UNKNOWN_LOCATION;
   targetm.target_option.override ();
+  input_location = saved_location;
 
   if (flag_diagnostics_generate_patch)
       global_dc->edit_context_ptr = new edit_context ();

	Jakub


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