aix: Move AIX math builtins before new builtin machinery.
authorDavid Edelsohn <dje.gcc@gmail.com>
Sun, 5 Dec 2021 01:23:09 +0000 (20:23 -0500)
committerDavid Edelsohn <dje.gcc@gmail.com>
Sun, 5 Dec 2021 01:28:17 +0000 (20:28 -0500)
The new builtin machinery has an early exit, so move the AIX-specific
builtins before the new machinery.

gcc/ChangeLog:

* config/rs6000/rs6000-call.c (rs6000_init_builtins): Move
AIX math builtin initialization before new_builtins_are_live.

gcc/config/rs6000/rs6000-call.c

index 141d2fc..d9736ea 100644 (file)
@@ -16479,6 +16479,29 @@ rs6000_init_builtins (void)
       fprintf (stderr, "\nEnd autogenerated built-in functions.\n\n\n");
      }
 
+  if (TARGET_XCOFF)
+    {
+      /* AIX libm provides clog as __clog.  */
+      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+       set_user_assembler_name (tdecl, "__clog");
+
+      /* When long double is 64 bit, some long double builtins of libc
+        functions (like __builtin_frexpl) must call the double version
+        (frexp) not the long double version (frexpl) that expects a 128 bit
+        argument.  */
+      if (! TARGET_LONG_DOUBLE_128)
+       {
+         if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
+           set_user_assembler_name (tdecl, "fmod");
+         if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
+           set_user_assembler_name (tdecl, "frexp");
+         if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
+           set_user_assembler_name (tdecl, "ldexp");
+         if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
+           set_user_assembler_name (tdecl, "modf");
+       }
+    }
+
   if (new_builtins_are_live)
     {
       altivec_builtin_mask_for_load
@@ -16578,29 +16601,6 @@ rs6000_init_builtins (void)
   def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
   def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
 
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-       set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-        functions (like __builtin_frexpl) must call the double version
-        (frexp) not the long double version (frexpl) that expects a 128 bit
-        argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
-       {
-         if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-           set_user_assembler_name (tdecl, "fmod");
-         if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-           set_user_assembler_name (tdecl, "frexp");
-         if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-           set_user_assembler_name (tdecl, "ldexp");
-         if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-           set_user_assembler_name (tdecl, "modf");
-       }
-    }
-
 #ifdef SUBTARGET_INIT_BUILTINS
   SUBTARGET_INIT_BUILTINS;
 #endif