PR fortran/39997
* intrinsic.c (add_functions): Add num_images.
* decl.c (gfc_match_end): Handle END CRITICAL.
* intrinsic.h (gfc_simplify_num_images): Add prototype.
* dump-parse-tree.c (show_code_node): Dump CRITICAL, ERROR STOP,
and SYNC.
* gfortran.h (gfc_statement): Add enum items for those.
(gfc_exec_op) Ditto.
(gfc_isym_id): Add num_images.
* trans-stmt.c (gfc_trans_stop): Handle ERROR STOP.
(gfc_trans_sync,gfc_trans_critical): New functions.
* trans-stmt.h (gfc_trans_stop,gfc_trans_sync,
gfc_trans_critical): Add/update prototypes.
* trans.c (gfc_trans_code): Handle CRITICAL, ERROR STOP,
and SYNC statements.
* trans.h (gfor_fndecl_error_stop_string) Add variable.
* resolve.c (resolve_sync): Add function.
(gfc_resolve_blocks): Handle CRITICAL.
(resolve_code): Handle CRITICAL, ERROR STOP,
(resolve_branch): Add CRITICAL constraint check.
and SYNC statements.
* st.c (gfc_free_statement): Add new statements.
* trans-decl.c (gfor_fndecl_error_stop_string): Global variable.
(gfc_build_builtin_function_decls): Initialize it.
* match.c (gfc_match_if): Handle ERROR STOP and SYNC.
(gfc_match_critical, gfc_match_error_stop, sync_statement,
gfc_match_sync_all, gfc_match_sync_images,
gfc_match_sync_memory):
New functions.
(match_exit_cycle): Handle CRITICAL constraint.
(gfc_match_stopcode): Handle ERROR STOP.
* match.h (gfc_match_critical, gfc_match_error_stop,
gfc_match_sync_all, gfc_match_sync_images,
gfc_match_sync_memory): Add prototype.
* parse.c (decode_statement, gfc_ascii_statement,
parse_executable): Handle new statements.
(parse_critical_block): New function.
* parse.h (gfc_compile_state): Add COMP_CRITICAL.
* intrinsic.texi (num_images): Document new function.
* simplify.c (gfc_simplify_num_images): Add function.
2010-04-06 Tobias Burnus <burnus@net-b.de>
PR fortran/39997
* gfortran.dg/coarray_1.f90: New test.
* gfortran.dg/coarray_2.f90: New test.
* gfortran.dg/coarray_3.f90: New test.
2010-04-06 Tobias Burnus <burnus@net-b.de>
PR fortran/39997
* runtime/stop.c (error_stop_string): New function.
* gfortran.map (_gfortran_error_stop_string): Add.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158008
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-04-06 Tobias Burnus <burnus@net-b.de>
+ PR fortran/39997
+ * intrinsic.c (add_functions): Add num_images.
+ * decl.c (gfc_match_end): Handle END CRITICAL.
+ * intrinsic.h (gfc_simplify_num_images): Add prototype.
+ * dump-parse-tree.c (show_code_node): Dump CRITICAL, ERROR STOP,
+ and SYNC.
+ * gfortran.h (gfc_statement): Add enum items for those.
+ (gfc_exec_op) Ditto.
+ (gfc_isym_id): Add num_images.
+ * trans-stmt.c (gfc_trans_stop): Handle ERROR STOP.
+ (gfc_trans_sync,gfc_trans_critical): New functions.
+ * trans-stmt.h (gfc_trans_stop,gfc_trans_sync,
+ gfc_trans_critical): Add/update prototypes.
+ * trans.c (gfc_trans_code): Handle CRITICAL, ERROR STOP,
+ and SYNC statements.
+ * trans.h (gfor_fndecl_error_stop_string) Add variable.
+ * resolve.c (resolve_sync): Add function.
+ (gfc_resolve_blocks): Handle CRITICAL.
+ (resolve_code): Handle CRITICAL, ERROR STOP,
+ (resolve_branch): Add CRITICAL constraint check.
+ and SYNC statements.
+ * st.c (gfc_free_statement): Add new statements.
+ * trans-decl.c (gfor_fndecl_error_stop_string): Global variable.
+ (gfc_build_builtin_function_decls): Initialize it.
+ * match.c (gfc_match_if): Handle ERROR STOP and SYNC.
+ (gfc_match_critical, gfc_match_error_stop, sync_statement,
+ gfc_match_sync_all, gfc_match_sync_images, gfc_match_sync_memory):
+ New functions.
+ (match_exit_cycle): Handle CRITICAL constraint.
+ (gfc_match_stopcode): Handle ERROR STOP.
+ * match.h (gfc_match_critical, gfc_match_error_stop,
+ gfc_match_sync_all, gfc_match_sync_images,
+ gfc_match_sync_memory): Add prototype.
+ * parse.c (decode_statement, gfc_ascii_statement,
+ parse_executable): Handle new statements.
+ (parse_critical_block): New function.
+ * parse.h (gfc_compile_state): Add COMP_CRITICAL.
+ * intrinsic.texi (num_images): Document new function.
+ * simplify.c (gfc_simplify_num_images): Add function.
+
+2010-04-06 Tobias Burnus <burnus@net-b.de>
+
PR fortran/43178
* trans-array.c (gfc_conv_expr_descriptor): Update
gfc_trans_scalar_assign call.
@end smallexample
@item @emph{See also}:
-@ref{THIS_IMAGE}, @ref{IMAGE_INDEX}
+@c FIXME: ref{THIS_IMAGE}
@end table
/* Matching subroutines in all sizes, shapes and colors.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Contributed by Andy Vaught
== FAILURE)
return MATCH_ERROR;
- if (gfc_option.coarray == GFC_FCOARRAY_NONE)
- {
- gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return MATCH_ERROR;
- }
-
if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
{
gfc_error ("Nested CRITICAL block at %C");
== FAILURE)
return MATCH_ERROR;
- if (gfc_option.coarray == GFC_FCOARRAY_NONE)
- {
- gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
- return MATCH_ERROR;
- }
-
if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
{
gfc_error ("Image control statement SYNC at %C in CRITICAL block");
&& gfc_simplify_expr (code->expr1, 0) == SUCCESS)
{
gfc_constructor *cons;
- cons = gfc_constructor_first (code->expr1->value.constructor);
- for (; cons; cons = gfc_constructor_next (cons))
+ for (cons = code->expr1->value.constructor; cons; cons = cons->next)
if (cons->expr->expr_type == EXPR_CONSTANT
&& mpz_cmp_si (cons->expr->value.integer, 1) < 0)
gfc_error ("Imageset argument at %L must between 1 and "
gfc_expr *
+gfc_simplify_num_images (void)
+{
+ gfc_expr *result;
+ /* FIXME: gfc_current_locus is wrong. */
+ result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, &gfc_current_locus);
+ mpz_set_si (result->value.integer, 1);
+ return result;
+}
+
+
+gfc_expr *
gfc_simplify_or (gfc_expr *x, gfc_expr *y)
{
gfc_expr *result;
+2010-04-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/39997
+ * gfortran.dg/coarray_1.f90: New test.
+ * gfortran.dg/coarray_2.f90: New test.
+ * gfortran.dg/coarray_3.f90: New test.
+
2010-04-06 Jason Merrill <jason@redhat.com>
PR c++/43648
sync images(*) ! { dg-error "Fortran 2008:" }
! num_images is implicitly defined:
-n = num_images() ! { dg-error "has no IMPLICIT type" }
+n = num_images() ! { dg-error "convert UNKNOWN to INTEGER" }
error stop 'stop' ! { dg-error "Fortran 2008:" }
end
! { dg-do run }
-! { dg-options "-fcoarray=single" }
! { dg-shouldfail "error stop" }
!
! Coarray support
! { dg-do compile }
-! { dg-options "-fcoarray=single" }
!
! Coarray support
! PR fortran/18918
+2010-04-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/39997
+ * runtime/stop.c (error_stop_string): New function.
+ * gfortran.map (_gfortran_error_stop_string): Add.
+
2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in: Regenerate.
PR libfortran/43605
* io/intrinsics.c (gf_ftell): New function, seek to correct offset.
- (ftell): Call gf_ftell.
+ (ftell): Call gf_ftell.
(FTELL_SUB): Likewise.
2010-04-01 Paul Thomas <pault@gcc.gnu.org>