{
tree array_type, array, var;
vec<constructor_elt, va_gc> *v = NULL;
+ static const int noptions = 7;
- /* Passing a new option to the library requires four modifications:
- + add it to the tree_cons list below
- + change the array size in the call to build_array_type
- + change the first argument to the library call
- gfor_fndecl_set_options
+ /* Passing a new option to the library requires three modifications:
+ + add it to the tree_cons list below
+ + change the noptions variable above
+ modify the library (runtime/compile_options.c)! */
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
gfc_option.allow_std));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (integer_type_node, pedantic));
- /* TODO: This is the old -fdump-core option, which is unused but
- passed due to ABI compatibility; remove when bumping the
- library ABI. */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (integer_type_node,
- 0));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (integer_type_node, flag_backtrace));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (integer_type_node,
(gfc_option.rtcheck
& GFC_RTCHECK_BOUNDS)));
- /* TODO: This is the -frange-check option, which no longer affects
- library behavior; when bumping the library ABI this slot can be
- reused for something else. As it is the last element in the
- array, we can instead leave it out altogether. */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (integer_type_node, 0));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (integer_type_node,
gfc_option.fpe_summary));
- array_type = build_array_type (integer_type_node,
- build_index_type (size_int (8)));
+ array_type = build_array_type_nelts (integer_type_node, noptions);
array = build_constructor (array_type, v);
TREE_CONSTANT (array) = 1;
TREE_STATIC (array) = 1;
/* Create a static variable to hold the jump table. */
var = build_decl (input_location, VAR_DECL,
- create_tmp_var_name ("options"),
- array_type);
+ create_tmp_var_name ("options"), array_type);
DECL_ARTIFICIAL (var) = 1;
DECL_IGNORED_P (var) = 1;
TREE_CONSTANT (var) = 1;
tmp = build_call_expr_loc (input_location,
gfor_fndecl_set_options, 2,
- build_int_cst (integer_type_node, 9), var);
+ build_int_cst (integer_type_node, noptions), var);
gfc_add_expr_to_block (&body, tmp);
}
compile_options.allow_std = options[1];
if (num >= 3)
compile_options.pedantic = options[2];
- /* options[3] is the removed -fdump-core option. Its place in the
- options array is retained due to ABI compatibility. Remove when
- bumping the library ABI. */
+ if (num >= 4)
+ compile_options.backtrace = options[3];
if (num >= 5)
- compile_options.backtrace = options[4];
+ compile_options.sign_zero = options[4];
if (num >= 6)
- compile_options.sign_zero = options[5];
+ compile_options.bounds_check = options[5];
if (num >= 7)
- compile_options.bounds_check = options[6];
- /* options[7] is the -frange-check option, which no longer affects
- the library behavior; range checking is now always done when
- parsing integers. Its place in the options array is retained due
- to ABI compatibility. Remove when bumping the library ABI. */
- if (num >= 9)
- compile_options.fpe_summary = options[8];
+ compile_options.fpe_summary = options[6];
#ifndef LIBGFOR_MINIMAL
/* If backtrace is required, we set signal handlers on the POSIX