summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2016-12-19 22:29:43 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2016-12-19 22:29:43 +0000
commit75b07bb45a8a4e20557744873f98681e2d17db1f (patch)
treed20bd66d44e63418a7efc78ea891d3383d0a2b62 /gcc/fortran
parente9c2033eff925ac2577ac6f30578bc6a8498c2e9 (diff)
downloadgcc-75b07bb45a8a4e20557744873f98681e2d17db1f.tar.gz
trans-decl.c (create_main_function): Remove unused elements to the set_options call.
* trans-decl.c (create_main_function): Remove unused elements to the set_options call. * runtime/compile_options.c (set_options): Remove unused elements. From-SVN: r243814
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-decl.c29
2 files changed, 12 insertions, 22 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8149bf927a5..06c2f52ed42 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,10 @@
2016-12-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ * trans-decl.c (create_main_function): Remove unused elements to
+ the set_options call.
+
+2016-12-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
* trans.h: Remove gfor_fndecl_stop_numeric_f08.
* trans-decl.c: Remove gfor_fndecl_stop_numeric_f08.
* trans-stmt.c (gfc_trans_stop): Use gfor_fndecl_stop_numeric
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 403f543a808..9d62d514ff3 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -5790,12 +5790,11 @@ create_main_function (tree fndecl)
{
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,
@@ -5806,12 +5805,6 @@ create_main_function (tree fndecl)
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,
@@ -5820,26 +5813,18 @@ create_main_function (tree fndecl)
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;
@@ -5851,7 +5836,7 @@ create_main_function (tree fndecl)
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);
}