mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/46079 (ABI for empty stop statement broken)
2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/46079 * runtime/stop.c (stop_numeric_f08): New function. (stop_numeric): Restore to previous behavior. * gfortran.map: Add symbol _gfortran_stop_numeric_f08. 2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/46079 * trans_stmt.c (gfc_trans_stop): Fix whitespace. Build a call to new F08 numeric stop function. * trans.h: Add declaration for gfor_fndecl_stop_numeric_f08. * trans-decl.c (gfc_build_builtin_function_decls): Build declaration for stop_numeric_f08. From-SVN: r165746
This commit is contained in:
parent
7cc2a03da2
commit
cea59acecf
|
|
@ -1,3 +1,12 @@
|
||||||
|
2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/46079
|
||||||
|
* trans_stmt.c (gfc_trans_stop): Fix whitespace. Build a call to new
|
||||||
|
F08 numeric stop function.
|
||||||
|
* trans.h: Add declaration for gfor_fndecl_stop_numeric_f08.
|
||||||
|
* trans-decl.c (gfc_build_builtin_function_decls): Build declaration
|
||||||
|
for stop_numeric_f08.
|
||||||
|
|
||||||
2010-10-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2010-10-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
* gfortran.h: Remove definition of bt enumerator.
|
* gfortran.h: Remove definition of bt enumerator.
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ tree gfc_static_ctors;
|
||||||
tree gfor_fndecl_pause_numeric;
|
tree gfor_fndecl_pause_numeric;
|
||||||
tree gfor_fndecl_pause_string;
|
tree gfor_fndecl_pause_string;
|
||||||
tree gfor_fndecl_stop_numeric;
|
tree gfor_fndecl_stop_numeric;
|
||||||
|
tree gfor_fndecl_stop_numeric_f08;
|
||||||
tree gfor_fndecl_stop_string;
|
tree gfor_fndecl_stop_string;
|
||||||
tree gfor_fndecl_error_stop_numeric;
|
tree gfor_fndecl_error_stop_numeric;
|
||||||
tree gfor_fndecl_error_stop_string;
|
tree gfor_fndecl_error_stop_string;
|
||||||
|
|
@ -2802,6 +2803,12 @@ gfc_build_builtin_function_decls (void)
|
||||||
/* STOP doesn't return. */
|
/* STOP doesn't return. */
|
||||||
TREE_THIS_VOLATILE (gfor_fndecl_stop_numeric) = 1;
|
TREE_THIS_VOLATILE (gfor_fndecl_stop_numeric) = 1;
|
||||||
|
|
||||||
|
gfor_fndecl_stop_numeric_f08 = gfc_build_library_function_decl (
|
||||||
|
get_identifier (PREFIX("stop_numeric_f08")),
|
||||||
|
void_type_node, 1, gfc_int4_type_node);
|
||||||
|
/* STOP doesn't return. */
|
||||||
|
TREE_THIS_VOLATILE (gfor_fndecl_stop_numeric_f08) = 1;
|
||||||
|
|
||||||
gfor_fndecl_stop_string = gfc_build_library_function_decl_with_spec (
|
gfor_fndecl_stop_string = gfc_build_library_function_decl_with_spec (
|
||||||
get_identifier (PREFIX("stop_string")), ".R.",
|
get_identifier (PREFIX("stop_string")), ".R.",
|
||||||
void_type_node, 2, pchar_type_node, gfc_int4_type_node);
|
void_type_node, 2, pchar_type_node, gfc_int4_type_node);
|
||||||
|
|
|
||||||
|
|
@ -602,25 +602,25 @@ gfc_trans_stop (gfc_code *code, bool error_stop)
|
||||||
{
|
{
|
||||||
tmp = build_int_cst (gfc_int4_type_node, 0);
|
tmp = build_int_cst (gfc_int4_type_node, 0);
|
||||||
tmp = build_call_expr_loc (input_location,
|
tmp = build_call_expr_loc (input_location,
|
||||||
error_stop ? gfor_fndecl_error_stop_string
|
error_stop ? gfor_fndecl_error_stop_string
|
||||||
: gfor_fndecl_stop_string,
|
: gfor_fndecl_stop_string,
|
||||||
2, build_int_cst (pchar_type_node, 0), tmp);
|
2, build_int_cst (pchar_type_node, 0), tmp);
|
||||||
}
|
}
|
||||||
else if (code->expr1->ts.type == BT_INTEGER)
|
else if (code->expr1->ts.type == BT_INTEGER)
|
||||||
{
|
{
|
||||||
gfc_conv_expr (&se, code->expr1);
|
gfc_conv_expr (&se, code->expr1);
|
||||||
tmp = build_call_expr_loc (input_location,
|
tmp = build_call_expr_loc (input_location,
|
||||||
error_stop ? gfor_fndecl_error_stop_numeric
|
error_stop ? gfor_fndecl_error_stop_numeric
|
||||||
: gfor_fndecl_stop_numeric, 1,
|
: gfor_fndecl_stop_numeric_f08, 1,
|
||||||
fold_convert (gfc_int4_type_node, se.expr));
|
fold_convert (gfc_int4_type_node, se.expr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gfc_conv_expr_reference (&se, code->expr1);
|
gfc_conv_expr_reference (&se, code->expr1);
|
||||||
tmp = build_call_expr_loc (input_location,
|
tmp = build_call_expr_loc (input_location,
|
||||||
error_stop ? gfor_fndecl_error_stop_string
|
error_stop ? gfor_fndecl_error_stop_string
|
||||||
: gfor_fndecl_stop_string,
|
: gfor_fndecl_stop_string,
|
||||||
2, se.expr, se.string_length);
|
2, se.expr, se.string_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfc_add_expr_to_block (&se.pre, tmp);
|
gfc_add_expr_to_block (&se.pre, tmp);
|
||||||
|
|
|
||||||
|
|
@ -589,6 +589,7 @@ void gfc_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, tree);
|
||||||
extern GTY(()) tree gfor_fndecl_pause_numeric;
|
extern GTY(()) tree gfor_fndecl_pause_numeric;
|
||||||
extern GTY(()) tree gfor_fndecl_pause_string;
|
extern GTY(()) tree gfor_fndecl_pause_string;
|
||||||
extern GTY(()) tree gfor_fndecl_stop_numeric;
|
extern GTY(()) tree gfor_fndecl_stop_numeric;
|
||||||
|
extern GTY(()) tree gfor_fndecl_stop_numeric_f08;
|
||||||
extern GTY(()) tree gfor_fndecl_stop_string;
|
extern GTY(()) tree gfor_fndecl_stop_string;
|
||||||
extern GTY(()) tree gfor_fndecl_error_stop_numeric;
|
extern GTY(()) tree gfor_fndecl_error_stop_numeric;
|
||||||
extern GTY(()) tree gfor_fndecl_error_stop_string;
|
extern GTY(()) tree gfor_fndecl_error_stop_string;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
2010-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR libgfortran/46079
|
||||||
|
* runtime/stop.c (stop_numeric_f08): New function.
|
||||||
|
(stop_numeric): Restore to previous behavior.
|
||||||
|
* gfortran.map: Add symbol _gfortran_stop_numeric_f08.
|
||||||
|
|
||||||
2010-10-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2010-10-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
* io/io.h: Remove definition of the BT enumerator.
|
* io/io.h: Remove definition of the BT enumerator.
|
||||||
|
|
|
||||||
|
|
@ -1141,6 +1141,7 @@ GFORTRAN_1.4 {
|
||||||
_gfortran_parity_l8;
|
_gfortran_parity_l8;
|
||||||
_gfortran_parity_l16;
|
_gfortran_parity_l16;
|
||||||
_gfortran_selected_real_kind2008;
|
_gfortran_selected_real_kind2008;
|
||||||
|
_gfortran_stop_numeric_f08;
|
||||||
_gfortran_transfer_array_write;
|
_gfortran_transfer_array_write;
|
||||||
_gfortran_transfer_character_write;
|
_gfortran_transfer_character_write;
|
||||||
_gfortran_transfer_character_wide_write;
|
_gfortran_transfer_character_wide_write;
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,30 @@ export_proto(stop_numeric);
|
||||||
|
|
||||||
void
|
void
|
||||||
stop_numeric (GFC_INTEGER_4 code)
|
stop_numeric (GFC_INTEGER_4 code)
|
||||||
|
{
|
||||||
|
if (code == -1)
|
||||||
|
code = 0;
|
||||||
|
else
|
||||||
|
st_printf ("STOP %d\n", (int)code);
|
||||||
|
|
||||||
|
sys_exit (code);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* A Fortran 2008 numeric STOP statement. */
|
||||||
|
|
||||||
|
extern void stop_numeric_f08 (GFC_INTEGER_4)
|
||||||
|
__attribute__ ((noreturn));
|
||||||
|
export_proto(stop_numeric_f08);
|
||||||
|
|
||||||
|
void
|
||||||
|
stop_numeric_f08 (GFC_INTEGER_4 code)
|
||||||
{
|
{
|
||||||
st_printf ("STOP %d\n", (int)code);
|
st_printf ("STOP %d\n", (int)code);
|
||||||
sys_exit (code);
|
sys_exit (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* A character string or blank STOP statement. */
|
/* A character string or blank STOP statement. */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -75,7 +94,8 @@ error_stop_string (const char *string, GFC_INTEGER_4 len)
|
||||||
sys_exit (1);
|
sys_exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A numeric or blank ERROR STOP statement. */
|
|
||||||
|
/* A numeric ERROR STOP statement. */
|
||||||
|
|
||||||
extern void error_stop_numeric (GFC_INTEGER_4)
|
extern void error_stop_numeric (GFC_INTEGER_4)
|
||||||
__attribute__ ((noreturn));
|
__attribute__ ((noreturn));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue