add __near to move some stuff into the data segment

This commit is contained in:
bebbo 2022-04-28 20:56:04 +02:00
parent 2bfe02097e
commit d129e0d61a
15 changed files with 133 additions and 19 deletions

View File

@ -284,7 +284,9 @@ struct fname_var_t
};
/* The three ways of getting then name of the current function. */
#ifdef __amiga__
__near
#endif
const struct fname_var_t fname_vars[] =
{
/* C99 compliant __func__, must be first. */

View File

@ -669,7 +669,9 @@ static const format_flag_pair strfmon_flag_pairs[] =
{ 0, 0, 0, 0 }
};
#ifdef __amiga__
__near
#endif
static const format_char_info print_char_table[] =
{
/* C89 conversion specifiers. */
@ -693,6 +695,9 @@ static const format_char_info print_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info asm_fprintf_char_table[] =
{
/* C89 conversion specifiers. */
@ -713,6 +718,9 @@ static const format_char_info asm_fprintf_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info gcc_diag_char_table[] =
{
/* C89 conversion specifiers. */
@ -734,6 +742,9 @@ static const format_char_info gcc_diag_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info gcc_tdiag_char_table[] =
{
/* C89 conversion specifiers. */
@ -757,6 +768,9 @@ static const format_char_info gcc_tdiag_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info gcc_cdiag_char_table[] =
{
/* C89 conversion specifiers. */
@ -780,6 +794,9 @@ static const format_char_info gcc_cdiag_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info gcc_cxxdiag_char_table[] =
{
/* C89 conversion specifiers. */
@ -806,6 +823,9 @@ static const format_char_info gcc_cxxdiag_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info gcc_gfc_char_table[] =
{
/* C89 conversion specifiers. */
@ -826,6 +846,9 @@ static const format_char_info gcc_gfc_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info scan_char_table[] =
{
/* C89 conversion specifiers. */
@ -874,6 +897,9 @@ static const format_char_info time_char_table[] =
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
#ifdef __amiga__
__near
#endif
static const format_char_info monetary_char_table[] =
{
{ "in", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "=^+(!-w#p", "", NULL },
@ -881,6 +907,9 @@ static const format_char_info monetary_char_table[] =
};
/* This must be in the same order as enum format_type. */
#ifdef __amiga__
__near
#endif
static const format_kind_info format_types_orig[] =
{
{ "gnu_printf", printf_length_specs, print_char_table, " +#0-'I", NULL,

View File

@ -32,7 +32,9 @@ along with GCC; see the file COPYING3. If not see
/* This is a list of flag variables that must match exactly, and their
names for the error message. The possible values for *flag_var must
fit in a 'signed char'. */
#ifdef __amiga__
__near
#endif
static const struct c_pch_matching
{
int *flag_var;

View File

@ -3956,6 +3956,9 @@ initialize_predefined_identifiers (void)
const predefined_identifier *pid;
/* A table of identifiers to create at startup. */
#ifdef __amiga__
__near
#endif
static const predefined_identifier predefined_identifiers[] = {
{ "C++", &lang_name_cplusplus, 0 },
{ "C", &lang_name_c, 0 },

View File

@ -40,6 +40,9 @@ along with GCC; see the file COPYING3. If not see
debugger or by the front-end for things like
__PRETTY_FUNCTION__. */
static cxx_pretty_printer actual_pretty_printer;
#ifdef __amiga__
__near
#endif
static cxx_pretty_printer * const cxx_pp = &actual_pretty_printer;
/* Translate if being used for diagnostics, but not for dump files or

View File

@ -1511,6 +1511,9 @@ emit_support_tinfos (void)
{
/* Dummy static variable so we can put nullptr in the array; it will be
set before we actually start to walk the array. */
#ifdef __amiga__
__near
#endif
static tree *const fundamentals[] =
{
&void_type_node,

View File

@ -4106,6 +4106,17 @@ finish_root_table (struct flist *flp, const char *pfx, const char *lastname,
for (fnum = 0; bitmap != 0; fnum++, bitmap >>= 1)
if (bitmap & 1)
{
char const * mf = get_output_file_name (CONST_CAST (input_file*, fli2->file));
if (0 == strcmp(mf, "gt-c-c-decl.h") ||
0 == strcmp(mf, "gt-c-family-c-common.h") ||
0 == strcmp(mf, "gt-c-c-parser.h") || 1
)
{
oprintf (base_files[fnum], "\n#ifdef __amiga__\n");
oprintf (base_files[fnum], "__attribute((section(\".data\")))\n");
oprintf (base_files[fnum], "#endif\n");
}
oprintf (base_files[fnum],
"extern const struct %s gt_%s_", tname, pfx);
put_mangled_filename (base_files[fnum], fli2->file);
@ -4116,8 +4127,19 @@ finish_root_table (struct flist *flp, const char *pfx, const char *lastname,
{
size_t fnum;
for (fnum = 0; base_files && fnum < num_lang_dirs; fnum++)
oprintf (base_files[fnum],
"EXPORTED_CONST struct %s * const %s[] = {\n", tname, name);
{
if (0 == strcmp(name, "gt_ggc_rtab") ||
0 == strcmp(name, "gt_pch_scalar_rtab") ||
0 == strcmp(name, "gt_ggc_r_gt_c_c_decl_h")
|| 1)
{
oprintf (base_files[fnum], "#ifdef __amiga__\n");
oprintf (base_files[fnum], "__attribute((section(\".data\")))\n");
oprintf (base_files[fnum], "#endif\n");
}
oprintf (base_files[fnum],
"EXPORTED_CONST struct %s * const %s[] = {\n", tname, name);
}
}
@ -4552,6 +4574,15 @@ write_roots (pair_p variables, bool emit_pch)
if (!fli->started_p)
{
fli->started_p = 1;
char const * mf = get_output_file_name (CONST_CAST (input_file*, v->line.file));
if (0 == strcmp(mf, "gt-c-c-decl.h") ||
0 == strcmp(mf, "gt-c-c-parser.h") || 1
)
{
oprintf (f, "\n#ifdef __amiga__\n");
oprintf (f, "__attribute((section(\".data\")))\n");
oprintf (f, "#endif\n");
}
oprintf (f, "EXPORTED_CONST struct ggc_root_tab gt_ggc_r_");
put_mangled_filename (f, v->line.file);
@ -4586,6 +4617,9 @@ write_roots (pair_p variables, bool emit_pch)
{
fli->started_p = 1;
oprintf (f, "#ifdef __amiga__\n");
oprintf (f, "__attribute((section(\".data\")))\n");
oprintf (f, "#endif\n");
oprintf (f, "EXPORTED_CONST struct ggc_root_tab gt_ggc_rd_");
put_mangled_filename (f, v->line.file);
oprintf (f, "[] = {\n");
@ -4660,6 +4694,14 @@ write_roots (pair_p variables, bool emit_pch)
{
fli->started_p = 1;
char const * mf = get_output_file_name (CONST_CAST (input_file*, v->line.file));
if (0 == strcmp(mf, "gt-c-c-decl.h") || 1)
{
oprintf (f, "\n#ifdef __amiga__\n");
oprintf (f, "__attribute((section(\".data\")))\n");
oprintf (f, "#endif\n");
}
oprintf (f, "EXPORTED_CONST struct ggc_root_tab gt_pch_rs_");
put_mangled_filename (f, v->line.file);
oprintf (f, "[] = {\n");

View File

@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "hosthooks.h"
#include "plugin.h"
#include <sys/resource.h>
/* When set, ggc_collect will do collection. */
bool ggc_force_collect;
@ -729,6 +730,7 @@ static double
ggc_rlimit_bound (double limit)
{
#if defined(HAVE_GETRLIMIT)
// && !defined __amiga__
struct rlimit rlim;
# if defined (RLIMIT_AS)
/* RLIMIT_AS is what POSIX says is the limit on mmap. Presumably

View File

@ -71,8 +71,17 @@ struct ggc_root_tab {
#define LAST_GGC_ROOT_TAB { NULL, 0, 0, NULL, NULL }
/* Pointers to arrays of ggc_root_tab, terminated by NULL. */
#ifndef __MAKE_MSYS2__
#ifdef __amiga__
__near
#endif
extern const struct ggc_root_tab * const gt_ggc_rtab[];
#ifdef __amiga__
__near
#endif
extern const struct ggc_root_tab * const gt_ggc_deletable_rtab[];
#ifdef __amiga__
__near
#endif
extern const struct ggc_root_tab * const gt_pch_scalar_rtab[];
#endif

View File

@ -45,6 +45,9 @@ static bool params_finished;
#undef DEFPARAMENUM5
#undef DEFPARAM
#ifdef __amiga__
__near
#endif
static const param_info lang_independent_params[] = {
#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) \
{ OPTION, DEFAULT, MIN, MAX, HELP, NULL },

View File

@ -3086,6 +3086,17 @@ finish_global_and_expr_insn (insn_t insn)
}
}
#ifdef __amiga__
__near
#endif
const static struct sched_scan_info_def ssi0 =
{
NULL, /* extend_bb */
finish_global_and_expr_for_bb, /* init_bb */
NULL, /* extend_insn */
finish_global_and_expr_insn /* init_insn */
};
/* Finalize per instruction data for the whole region. */
void
sel_finish_global_and_expr (void)
@ -3101,13 +3112,7 @@ sel_finish_global_and_expr (void)
/* Clear AV_SETs and INSN_EXPRs. */
{
const struct sched_scan_info_def ssi =
{
NULL, /* extend_bb */
finish_global_and_expr_for_bb, /* init_bb */
NULL, /* extend_insn */
finish_global_and_expr_insn /* init_insn */
};
struct sched_scan_info_def ssi = ssi0;
sched_scan (&ssi, bbs);
}

View File

@ -3603,7 +3603,6 @@ vect_create_vectorized_promotion_stmts (vec<tree> *vec_oprnds0,
If VEC_STMT is also passed, vectorize the STMT: create a vectorized
stmt to replace it, put it in VEC_STMT, and insert it at GSI.
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
static bool
vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
gimple **vec_stmt, slp_tree slp_node)
@ -3619,7 +3618,7 @@ vectorizable_conversion (gimple *stmt, gimple_stmt_iterator *gsi,
tree decl1 = NULL_TREE, decl2 = NULL_TREE;
tree new_temp;
gimple *def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
enum vect_def_type dt[2]; dt[0] = vect_unknown_def_type; dt[1] = vect_unknown_def_type;
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info;
int nunits_in;
@ -4209,7 +4208,7 @@ vectorizable_assignment (gimple *stmt, gimple_stmt_iterator *gsi,
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
tree new_temp;
gimple *def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
enum vect_def_type dt[2]; dt[0] = vect_unknown_def_type; dt[1] = vect_unknown_def_type;
int ncopies;
int i, j;
vec<tree> vec_oprnds = vNULL;
@ -4420,7 +4419,7 @@ vectorizable_shift (gimple *stmt, gimple_stmt_iterator *gsi,
int icode;
machine_mode optab_op2_mode;
gimple *def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
enum vect_def_type dt[2]; dt[0] = vect_unknown_def_type; dt[1] = vect_unknown_def_type;
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info;
int nunits_in;
@ -4793,8 +4792,8 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
optab optab;
bool target_support_p;
gimple *def_stmt;
enum vect_def_type dt[3]
= {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type};
enum vect_def_type dt[3];
dt[0] = vect_unknown_def_type; dt[1] = vect_unknown_def_type; dt[2] = vect_unknown_def_type;
gimple *new_stmt = NULL;
stmt_vec_info prev_stmt_info;
int nunits_in;
@ -7827,7 +7826,7 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
tree vec_rhs1 = NULL_TREE, vec_rhs2 = NULL_TREE;
tree new_temp;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
enum vect_def_type dts[2] = {vect_unknown_def_type, vect_unknown_def_type};
enum vect_def_type dts[2]; dts[0] = vect_unknown_def_type; dts[1] = vect_unknown_def_type;
unsigned nunits;
int ncopies;
enum tree_code code;

View File

@ -440,6 +440,9 @@ static inline void
fde_split (struct object *ob, fde_compare_t fde_compare,
struct fde_vector *linear, struct fde_vector *erratic)
{
#ifdef __amiga__
__near
#endif
static const fde *marker;
size_t count = linear->count;
const fde *const *chain_end = &marker;
@ -749,6 +752,9 @@ init_object (struct object* ob)
count = classify_object_over_fdes (ob, ob->u.single);
if (count == (size_t) -1)
{
#ifdef __amiga__
__near
#endif
static const fde terminator;
unhandled_fdes:
ob->s.i = 0;

View File

@ -2250,6 +2250,9 @@ d_ctor_dtor_name (struct d_info *di)
::= u <source-name>
*/
#ifdef __amiga__
__near
#endif
CP_STATIC_IF_GLIBCPP_V3
const struct demangle_builtin_type_info
cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =

View File

@ -180,6 +180,9 @@ extern const struct demangle_operator_info cplus_demangle_operators[];
#define D_BUILTIN_TYPE_COUNT (33)
#ifdef __amiga__
__near
#endif
CP_STATIC_IF_GLIBCPP_V3
const struct demangle_builtin_type_info
cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT];