public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Subject: [PATCH 6/6] x86: don't accept base architectures as extensions
Date: Wed, 16 Mar 2022 09:48:48 +0100	[thread overview]
Message-ID: <cecd9f1b-8e9e-48f6-1c5f-76d8fa4aa8f3@suse.com> (raw)
In-Reply-To: <93cecdf2-b805-4508-9e34-89fd0011ccc9@suse.com>

The -march= intentions are quite clear: A base architecture may be
followed by any number of extensions. Accepting a base architecture in
place of an extension will at best result in confusion, as the first of
the two (or more) items specified simply would not take effect, due to
being overridden by the later one(s).

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -13263,7 +13263,7 @@ md_parse_option (int c, const char *arg)
 	    *next++ = '\0';
 	  for (j = 0; j < ARRAY_SIZE (cpu_arch); j++)
 	    {
-	      if (strcmp (arch, cpu_arch [j].name) == 0)
+	      if (arch == saved && strcmp (arch, cpu_arch [j].name) == 0)
 		{
 		  /* Processor.  */
 		  if (! cpu_arch[j].flags.bitfield.cpui386)
--- /dev/null
+++ b/gas/testsuite/gas/i386/arch-10-5.l
@@ -0,0 +1,2 @@
+Assembler messages:
+Fatal error: .*
--- /dev/null
+++ b/gas/testsuite/gas/i386/arch-10-5.s
@@ -0,0 +1 @@
+	.text
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -199,6 +199,7 @@ if [gas_32_check] then {
     run_list_test "arch-10-2" "-march=i686 -I${srcdir}/$subdir -al"
     run_list_test "arch-10-3" "-march=i686+mmx+sse4.2 -I${srcdir}/$subdir -al"
     run_list_test "arch-10-4" "-march=i686+mmx+sse4+vmx+smx -I${srcdir}/$subdir -al"
+    run_list_test "arch-10-5" "-march=generic32+i686 -al"
     run_dump_test "arch-11"
     run_dump_test "arch-12"
     run_dump_test "arch-13"


  parent reply	other threads:[~2022-03-16  8:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  8:42 [PATCH 0/6] x86: drop L1OM/K1OM from gas plus associated tidying Jan Beulich
2022-03-16  8:45 ` [PATCH 1/6] x86: assorted IAMCU CPU checking fixes Jan Beulich
2022-03-16  8:46 ` [PATCH 2/6] x86: drop L1OM/K1OM support from gas Jan Beulich
2022-03-16  8:46 ` [PATCH 3/6] x86: add another IAMCU testcase Jan Beulich
2022-05-18 17:46   ` H.J. Lu
2022-03-16  8:47 ` [PATCH 4/6] x86: unify CPU flag on/off processing Jan Beulich
2022-03-16  8:48 ` [PATCH 5/6] x86: never set i386_cpu_flags' "unused" field Jan Beulich
2022-03-16  8:48 ` Jan Beulich [this message]
2022-03-16 17:11 ` [PATCH 0/6] x86: drop L1OM/K1OM from gas plus associated tidying H.J. Lu
2022-03-17  8:32   ` Jan Beulich
2022-03-17 15:11     ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cecd9f1b-8e9e-48f6-1c5f-76d8fa4aa8f3@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).