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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the bug is that
  if (!strcmp (opts->x_ix86_arch_string, "generic"))
    error ("generic CPU can be used only for %stune=%s %s",
           prefix, suffix, sw);
  else if (!strcmp (opts->x_ix86_arch_string, "intel"))
    error ("intel CPU can be used only for %stune=%s %s",
           prefix, suffix, sw);
is too late.
I'd stick it into:
  for (i = 0; i < pta_size; i++)
    if (! strcmp (opts->x_ix86_arch_string, processor_alias_table[i].name))
      {
HERE ------------>
        ix86_schedule = processor_alias_table[i].schedule;
and if emitting the error, just break, so that neither ix86_arch nor
opts->x_ix86_isa_flags is affected.
Similarly, the "CPU you selected does not support x86-64 " error should not
affect these.

Perhaps it would be helpful to go over the whole ix86_option_override_internal
and for all errors emitted in there make sure that beyond reporting errors the
function doesn't keep the options in an invalid state - changes them to some
sane defaults on errors.
Some places already do that:
      error ("-mstringop-strategy=rep_8byte not supported for 32-bit code");
      opts->x_ix86_stringop_alg = no_stringop;
etc., but other spots don't.

Reply via email to