Commit a60658ba by Jerry DeLisle

re PR fortran/36515 (Integer read from stdin yields a value overflow for a valid integer.)

2008-06-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36515
	* trans-decl.c (gfc_generate_function_code): Add range_check to options
	array.

From-SVN: r136821
parent f4df5771
2008-06-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/36515
* trans-decl.c (gfc_generate_function_code): Add range_check to options
array.
2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gfc-internals.texi: Expand TABs, drop indentation outside examples. * gfc-internals.texi: Expand TABs, drop indentation outside examples.
......
...@@ -3292,9 +3292,13 @@ gfc_generate_function_code (gfc_namespace * ns) ...@@ -3292,9 +3292,13 @@ gfc_generate_function_code (gfc_namespace * ns)
build_int_cst (integer_type_node, build_int_cst (integer_type_node,
flag_bounds_check), array); flag_bounds_check), array);
array = tree_cons (NULL_TREE,
build_int_cst (integer_type_node,
gfc_option.flag_range_check), array);
array_type = build_array_type (integer_type_node, array_type = build_array_type (integer_type_node,
build_index_type (build_int_cst (NULL_TREE, build_index_type (build_int_cst (NULL_TREE,
6))); 7)));
array = build_constructor_from_list (array_type, nreverse (array)); array = build_constructor_from_list (array_type, nreverse (array));
TREE_CONSTANT (array) = 1; TREE_CONSTANT (array) = 1;
TREE_STATIC (array) = 1; TREE_STATIC (array) = 1;
...@@ -3308,7 +3312,7 @@ gfc_generate_function_code (gfc_namespace * ns) ...@@ -3308,7 +3312,7 @@ gfc_generate_function_code (gfc_namespace * ns)
var = gfc_build_addr_expr (pvoid_type_node, var); var = gfc_build_addr_expr (pvoid_type_node, var);
tmp = build_call_expr (gfor_fndecl_set_options, 2, tmp = build_call_expr (gfor_fndecl_set_options, 2,
build_int_cst (integer_type_node, 7), var); build_int_cst (integer_type_node, 8), var);
gfc_add_expr_to_block (&body, tmp); gfc_add_expr_to_block (&body, tmp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment