Don't build insn-extract.o with rtl checking
[gcc.git] / gcc / brig / brig-lang.c
index 997dad4191cc933ca20055518a5ea9bcc1330dac..15d2b0b4fe470d8387f84169a54496e6db9a2d1a 100644 (file)
@@ -1,5 +1,5 @@
 /* brig-lang.c -- brig (HSAIL) input gcc interface.
-   Copyright (C) 2016-2018 Free Software Foundation, Inc.
+   Copyright (C) 2016-2020 Free Software Foundation, Inc.
    Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com>
    for General Processor Tech.
 
@@ -57,7 +57,7 @@ static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
 static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
 static tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *);
 
-/* This file is based on Go frontent'd go-lang.c and gogo-tree.cc.  */
+/* This file is based on Go frontend's go-lang.c and gogo-tree.cc.  */
 
 /* If -v set.  */
 
@@ -123,7 +123,7 @@ brig_langhook_init_options_struct (struct gcc_options *opts)
   /* If we set this to one, the whole program optimizations internalize
      all global variables, making them invisible to the dyn loader (and
      thus the HSA runtime implementation).  */
-  opts->x_flag_whole_program = 0;
+  opts->x_flag_whole_program = 1;
 
   /* The builtin math functions should not set errno.  */
   opts->x_flag_errno_math = 0;
@@ -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.  */
@@ -143,7 +145,7 @@ brig_langhook_init_options_struct (struct gcc_options *opts)
 static bool
 brig_langhook_handle_option
   (size_t scode, const char *arg ATTRIBUTE_UNUSED,
-  int value ATTRIBUTE_UNUSED, int kind ATTRIBUTE_UNUSED,
+  HOST_WIDE_INT value ATTRIBUTE_UNUSED, int kind ATTRIBUTE_UNUSED,
   location_t loc ATTRIBUTE_UNUSED,
   const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED)
 {
@@ -164,12 +166,18 @@ brig_langhook_handle_option
 static bool
 brig_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
 {
-  if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
-    flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
+  if (flag_excess_precision == EXCESS_PRECISION_DEFAULT)
+    flag_excess_precision = EXCESS_PRECISION_STANDARD;
 
-  /* gccbrig casts pointers around like crazy, TBAA produces
-     broken code if not force disabling it.  */
-  flag_strict_aliasing = 0;
+  /* gccbrig casts pointers around like crazy, TBAA might produce broken
+     code if not disabling it by default.  Some PRM conformance tests such
+     as prm/core/memory/ordinary/ld/ld_u16 fail currently with strict
+     aliasing (to fix).  It can be enabled from the command line for cases
+     that are known not to break the C style aliasing requirements.  */
+  if (!global_options_set.x_flag_strict_aliasing)
+    flag_strict_aliasing = 0;
+  else
+    flag_strict_aliasing = global_options.x_flag_strict_aliasing;
 
   /* Returning false means that the backend should be used.  */
   return false;
@@ -579,6 +587,7 @@ static GTY(()) tree signed_size_type_node;
 int flag_isoc94;
 int flag_isoc99;
 int flag_isoc11;
+int flag_isoc2x;
 
 static void
 def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
@@ -629,9 +638,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;
@@ -644,12 +655,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);
 }
 
@@ -860,10 +865,12 @@ brig_build_c_type_nodes (void)
       for (i = 0; i < NUM_INT_N_ENTS; i++)
        if (int_n_enabled_p[i])
          {
-           char name[50];
+           char name[50], altname[50];
            sprintf (name, "__int%d unsigned", int_n_data[i].bitsize);
+           sprintf (altname, "__int%d__ unsigned", int_n_data[i].bitsize);
 
-           if (strcmp (name, SIZE_TYPE) == 0)
+           if (strcmp (name, SIZE_TYPE) == 0
+               || strcmp (altname, SIZE_TYPE) == 0)
              {
                intmax_type_node = int_n_trees[i].signed_type;
                uintmax_type_node = int_n_trees[i].unsigned_type;