On 5 September 2016 at 19:20, Jakub Jelinek <ja...@redhat.com> wrote:
> 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  <ja...@redhat.com>
>
>         PR middle-end/77475
>         * toplev.c (process_options): Temporarily set input_location
>         to UNKNOWN_LOCATION around targetm.target_option.override () call.
>

Hi,

This patch caused regressions on aarch64. The following tests now fail:
  gcc.target/aarch64/arch-diagnostics-1.c  (test for errors, line 1)
  gcc.target/aarch64/arch-diagnostics-1.c (test for excess errors)
  gcc.target/aarch64/arch-diagnostics-2.c  (test for errors, line 1)
  gcc.target/aarch64/arch-diagnostics-2.c (test for excess errors)
  gcc.target/aarch64/cpu-diagnostics-1.c  (test for errors, line 1)
  gcc.target/aarch64/cpu-diagnostics-1.c (test for excess errors)
  gcc.target/aarch64/cpu-diagnostics-2.c  (test for errors, line 1)
  gcc.target/aarch64/cpu-diagnostics-2.c (test for excess errors)
  gcc.target/aarch64/cpu-diagnostics-3.c  (test for errors, line 1)
  gcc.target/aarch64/cpu-diagnostics-3.c (test for excess errors)
  gcc.target/aarch64/cpu-diagnostics-4.c  (test for errors, line 1)
  gcc.target/aarch64/cpu-diagnostics-4.c (test for excess errors)

Christophe


> --- 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

Reply via email to