[Bug tree-optimization/92860] [8/9/10 regression] Global flags affected by -O settings are clobbered by optimize attribute

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 11 14:47:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
param_min_crossjump_insns is changed here when we switch optimization level:

  if (opts->x_optimize_size)
    /* We want to crossjump as much as possible.  */
    SET_OPTION_IF_UNSET (opts, opts_set, param_min_crossjump_insns, 1);

Similarly for param_max_combine_insns:

  /* Restrict the amount of work combine does at -Og while retaining
     most of its useful transforms.  */
  if (opts->x_optimize_debug)
    SET_OPTION_IF_UNSET (opts, opts_set, param_max_combine_insns, 2);

likely here:

  /* -O2 param settings.  */
  opt2 = (opts->x_optimize >= 2);
...

  /* Track fields in field-sensitive alias analysis.  */
  if (opt2)
    SET_OPTION_IF_UNSET (opts, opts_set, param_max_fields_for_field_sensitive,
                         100);


More information about the Gcc-bugs mailing list