/* 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.
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. */
/* 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;
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. */
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)
{
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;
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, ...)
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;
(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);
}
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;