]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[BRIGFE] do not allow optimizations based on known C builtins
authorPekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
Fri, 4 May 2018 18:01:11 +0000 (18:01 +0000)
committerPekka Jääskeläinen <visit0r@gcc.gnu.org>
Fri, 4 May 2018 18:01:11 +0000 (18:01 +0000)
It can break inputs that have similarly named functions.

From-SVN: r259949

gcc/brig/ChangeLog
gcc/brig/brig-lang.c

index 40a715664fd33d0433206edcfec611c7672df8cc..7da06bc7d89fdee99ae96e256fead1b428817ecb 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-04  Pekka Jääskeläinen  <pekka.jaaskelainen@parmance.com>
+
+       * brig/brig-lang.c: Do not allow optimizations based on known C
+       builtins.
+
 2018-05-04  Pekka Jääskeläinen  <pekka.jaaskelainen@parmance.com>
 
        * brig/brig-lang.c: Allow controlling strict aliasing from
index 58b98fd56a3c76d2aeaac28235c7ba2dcb2a567f..3c4d4bdcd458f2b672c2c0334a4867abc7a7d8d8 100644 (file)
@@ -136,6 +136,8 @@ brig_langhook_init_options_struct (struct gcc_options *opts)
   opts->x_flag_signed_zeros = 1;
 
   opts->x_optimize = 3;
+
+  flag_no_builtin = 1;
 }
 
 /* Handle Brig specific options.  Return 0 if we didn't do anything.  */
@@ -635,9 +637,11 @@ builtin_type_for_size (int size, bool unsignedp)
 
 static void
 def_builtin_1 (enum built_in_function fncode, const char *name,
-              enum built_in_class fnclass, tree fntype, tree libtype,
-              bool both_p, bool fallback_p, bool nonansi_p,
-              tree fnattrs, bool implicit_p)
+              enum built_in_class fnclass ATTRIBUTE_UNUSED,
+              tree fntype, tree libtype ATTRIBUTE_UNUSED,
+              bool both_p ATTRIBUTE_UNUSED, bool fallback_p,
+              bool nonansi_p ATTRIBUTE_UNUSED, tree fnattrs,
+              bool implicit_p)
 {
   tree decl;
   const char *libname;
@@ -650,12 +654,6 @@ def_builtin_1 (enum built_in_function fncode, const char *name,
                               (fallback_p ? libname : NULL),
                               fnattrs);
 
-  if (both_p
-      && !flag_no_builtin
-      && !(nonansi_p && flag_no_nonansi_builtin))
-    add_builtin_function (libname, libtype, fncode, fnclass,
-                         NULL, fnattrs);
-
   set_builtin_decl (fncode, decl, implicit_p);
 }