summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-24 05:52:44 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-24 05:52:44 +0000
commitc086aee152958250310d4f5ea3df854436c764fa (patch)
tree977427f50ee91accd2a6424d4d19533a4274a057 /gcc/fortran/trans-decl.c
parentad4ce1d1a273c7509109ecfaa31beacbe4e071d6 (diff)
downloadgcc-c086aee152958250310d4f5ea3df854436c764fa.tar.gz
2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/30814 * trans-decl.c (generate_function_code): Add argument for flag_bounds_check to the array for set_options. * invoke.texi: Mention that some checks require -fbounds-check to be set during compilation of the main program. 2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/30814 * libgfortran.h: Add bounds_check to compile_options_t. * runtime/compile_options.c (set_options): Add handling of compile_options.bounds_check. * intrinsics/pack_generic.c (pack_internal): Also determine the number of elements if compile_options.bounds_check is true. Raise runtime error if a different array shape is detected. 2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/30814 * gfortran.dg/pack_bounds_1.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 0acd5f8c14f..1fd4373ff9e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3191,9 +3191,13 @@ gfc_generate_function_code (gfc_namespace * ns)
build_int_cst (gfc_c_int_type_node,
gfc_option.flag_sign_zero), array);
+ array = tree_cons (NULL_TREE,
+ build_int_cst (gfc_c_int_type_node,
+ flag_bounds_check), array);
+
array_type = build_array_type (gfc_c_int_type_node,
build_index_type (build_int_cst (NULL_TREE,
- 5)));
+ 6)));
array = build_constructor_from_list (array_type, nreverse (array));
TREE_CONSTANT (array) = 1;
TREE_INVARIANT (array) = 1;
@@ -3209,7 +3213,7 @@ gfc_generate_function_code (gfc_namespace * ns)
var = gfc_build_addr_expr (pvoid_type_node, var);
tmp = build_call_expr (gfor_fndecl_set_options, 2,
- build_int_cst (gfc_c_int_type_node, 6), var);
+ build_int_cst (gfc_c_int_type_node, 7), var);
gfc_add_expr_to_block (&body, tmp);
}