[Bug preprocessor/99313] ICE while changing global target options via pragma

2021-03-01 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99313

--- Comment #4 from Martin Liška  ---
(In reply to Richard Biener from comment #3)
> But this results in unexpected behavior when there's functions with arch=z13
> vs. arch=z9 and depending on "luck" we then inherit the wrong params where
> we should not?

Yes.

> 
> That said, when unifying target/optimize options these should be handled
> and stored once, right?

Exactly, that's the original motivation for merging of them.

[Bug preprocessor/99313] ICE while changing global target options via pragma

2021-03-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99313

--- Comment #3 from Richard Biener  ---
But this results in unexpected behavior when there's functions with arch=z13
vs. arch=z9 and depending on "luck" we then inherit the wrong params where
we should not?

That said, when unifying target/optimize options these should be handled
and stored once, right?

[Bug preprocessor/99313] ICE while changing global target options via pragma

2021-03-01 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99313

Martin Liška  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-03-01

--- Comment #2 from Martin Liška  ---
The diff comes from here:

(gdb) p ptr1->x_param_max_completely_peel_times
$3 = 16
(gdb) p ptr2->x_param_max_completely_peel_times
$4 = 64

Which comes from here:

  if (opts->x_s390_tune >= PROCESSOR_2097_Z10)
{
  SET_OPTION_IF_UNSET (opts, opts_set, param_max_unrolled_insns,
   100);
  SET_OPTION_IF_UNSET (opts, opts_set, param_max_unroll_times, 32);
  SET_OPTION_IF_UNSET (opts, opts_set, param_max_completely_peeled_insns,
   2000);
  SET_OPTION_IF_UNSET (opts, opts_set, param_max_completely_peel_times,
   64);
}

So this is an obvious situation where a target option modified optimization
options that is global.
I'm going to add exceptions for it.

[Bug preprocessor/99313] ICE while changing global target options via pragma

2021-03-01 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99313

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
g:dc6d15eaa23cbae1468a6ef92371b1c856c14819