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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-17
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |uros at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I bet this goes all the way down to r125180 or so, ix86_handle_option returns
false for OPT_3dnowa.  So, either the option should not be recognized, then we
should add Ignore to it etc., or we should make it work (again?).  Right now it
seems the effect of -m3dnowa happens only if -march= for a CPU that includes
3dnowa is included.

To make -m3dnowa work, perhaps something like following would DTRT (plus
testcases):
--- gcc/common/config/i386/i386-common.c.jj     2017-01-12 22:29:00.000000000
+0100
+++ gcc/common/config/i386/i386-common.c        2017-02-17 10:55:20.023152107
+0100
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3.
 #define OPTION_MASK_ISA_MMX_SET OPTION_MASK_ISA_MMX
 #define OPTION_MASK_ISA_3DNOW_SET \
   (OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_MMX_SET)
+#define OPTION_MASK_ISA_3DNOW_A_SET \
+  (OPTION_MASK_ISA_3DNOW_A | OPTION_MASK_ISA_3DNOW_SET)

 #define OPTION_MASK_ISA_SSE_SET OPTION_MASK_ISA_SSE
 #define OPTION_MASK_ISA_SSE2_SET \
@@ -291,7 +293,17 @@ ix86_handle_option (struct gcc_options *
       return true;

     case OPT_m3dnowa:
-      return false;
+      if (value)
+       {
+         opts->x_ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_A_SET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_A_SET;
+       }
+      else
+       {
+         opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_A_UNSET;
+         opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_A_UNSET;
+       }
+      return true;

     case OPT_msse:
       if (value)

Reply via email to