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

--- Comment #20 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Can you be more concrete about what's wrong with that? I haven't changed the
> conditions that drop the flag, but only make it respect pragmas.

Previously the opts.c logic would trigger only with the pragma, now it triggers
even without it, disabling flag_reorder_blocks_and_partition in all cases:

  /* If user requested unwind info, then turn off the partitioning
     optimization.  */

  if (opts->x_flag_unwind_tables
      && !targetm_common.unwind_tables_default
      && opts->x_flag_reorder_blocks_and_partition
      && (ui_except == UI_SJLJ || ui_except >= UI_TARGET))
    {
      if (opts_set->x_flag_reorder_blocks_and_partition)
        inform (loc,
                "%<-freorder-blocks-and-partition%> does not support "
                "unwind info on this architecture");
      opts->x_flag_reorder_blocks_and_partition = 0;
      opts->x_flag_reorder_blocks = 1;
    }

  /* If the target requested unwind info, then turn off the partitioning
     optimization with a different message.  Likewise, if the target does not
     support named sections.  */

  if (opts->x_flag_reorder_blocks_and_partition
      && (!targetm_common.have_named_sections
          || (opts->x_flag_unwind_tables
              && targetm_common.unwind_tables_default
              && (ui_except == UI_SJLJ || ui_except >= UI_TARGET))))
    {
      if (opts_set->x_flag_reorder_blocks_and_partition)
        inform (loc,
                "%<-freorder-blocks-and-partition%> does not work "
                "on this architecture");
      opts->x_flag_reorder_blocks_and_partition = 0;
      opts->x_flag_reorder_blocks = 1;
    }


I guess that we need to define TARGET_UNWIND_TABLES_DEFAULT for 64-bit Windows
but that would probably only generate the second error instead of the first,
and we need none since -freorder-blocks-and-partition works fine there.

Reply via email to