rs6000: Allow -mabi=no-altivec override on command line for AIX.
authorDavid Edelsohn <dje.gcc@gmail.com>
Mon, 19 Oct 2020 17:11:56 +0000 (13:11 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Tue, 20 Oct 2020 19:38:44 +0000 (15:38 -0400)
The override options machinery to set rs6000_altivec_abi for AIX
doesn't check if the option is set on the command line.  This patch
checks for a command line option to not override it.

gcc/ChangeLog:

* config/rs6000/rs6000.c (rs6000_option_override_internal):
Don't implcitly enable Altivec ABI if set on the command line.

gcc/config/rs6000/rs6000.c

index b58eeae2b98cf117026e20665831e9f59d9ace6d..d05b85c3cdbc8377c712a6e8e8f43f7c8921adae 100644 (file)
@@ -4324,7 +4324,9 @@ rs6000_option_override_internal (bool global_init_p)
     }
 
   /* Enable Altivec ABI for AIX -maltivec.  */
-  if (TARGET_XCOFF && (TARGET_ALTIVEC || TARGET_VSX))
+  if (TARGET_XCOFF
+      && (TARGET_ALTIVEC || TARGET_VSX)
+      && !global_options_set.x_rs6000_altivec_abi)
     {
       if (main_target_opt != NULL && !main_target_opt->x_rs6000_altivec_abi)
        error ("target attribute or pragma changes AltiVec ABI");