It started with g:
3e2ae3ee285a57455d5a23bd352a68c289130186 where
new entry was added to processor_alias_table after generic node:
+ {"amdfam19h", PROCESSOR_GENERIC, CPU_GENERIC, 0,
+ M_CPU_TYPE (AMDFAM19H), P_NONE},
and then the following is violated:
/* NB: processor_alias_table stops at the "generic" entry. */
gcc/ChangeLog:
PR target/99753
* common/config/i386/i386-common.c (ARRAY_SIZE): Fix off-by-one
error.
* config/i386/i386-options.c (ix86_option_override_internal):
Add run-time assert.
gcc/testsuite/ChangeLog:
PR target/99753
* gcc.target/i386/pr99753.c: New test.
};
/* NB: processor_alias_table stops at the "generic" entry. */
-unsigned int const pta_size = ARRAY_SIZE (processor_alias_table) - 6;
+unsigned int const pta_size = ARRAY_SIZE (processor_alias_table) - 7;
unsigned int const num_arch_names = ARRAY_SIZE (processor_alias_table);
/* Provide valid option values for -march and -mtune options. */
sorry ("%i-bit mode not compiled in",
(opts->x_ix86_isa_flags & OPTION_MASK_ISA_64BIT) ? 64 : 32);
+ /* Last processor_alias_table must point to "generic" entry. */
+ gcc_checking_assert (strcmp (processor_alias_table[pta_size - 1].name,
+ "generic") == 0);
for (i = 0; i < pta_size; i++)
if (! strcmp (opts->x_ix86_arch_string, processor_alias_table[i].name))
{
--- /dev/null
+/* PR target/99753 */
+
+/* { dg-do compile } */
+/* { dg-options "-march=amd -m32" } */
+/* { dg-error "bad value .'amd'. for '-march=' switch" "" { target *-*-* } 0 } */